Fix import order and handle GraphQL errors in upload onCompleted

- Move DialogFooter before type DialogRef to satisfy import-x/order
- Check errors argument in onCompleted callback to avoid treating
  GraphQL errors as successful uploads

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2026-03-18 17:40:16 +01:00
parent 65e3bd014b
commit d360725d24

View File

@@ -11,8 +11,8 @@ import {
Button, Button,
Dialog, Dialog,
DialogContent, DialogContent,
type DialogRef,
DialogFooter, DialogFooter,
type DialogRef,
Field, Field,
IconUpload, IconUpload,
Input, Input,
@@ -144,7 +144,13 @@ export function CreateAuditDialog({
uploadables: { uploadables: {
"input.file": file, "input.file": file,
}, },
onCompleted: () => resolve(), onCompleted: (_response, errors) => {
if (errors) {
reject(errors);
} else {
resolve();
}
},
onError: error => reject(error), onError: error => reject(error),
}); });
}); });