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:
@@ -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),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user