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