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