Skip to content

Commit

Permalink
Fix upload editors not showing the errors returned from TemporaryUplo…
Browse files Browse the repository at this point in the history
…ad, and assuming upload successful even when it is not due to blacklist or some other validation error
  • Loading branch information
volkanceylan committed Jun 5, 2024
1 parent 54e26bb commit f61bb96
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/corelib/src/ui/helpers/uploadhelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,14 @@ export namespace UploadHelper {

new Uploader({
batchSize: 1,
batchSuccess: data => options.fileDone?.(data.response ?? {}, data.batch?.filePaths?.[0], data),
batchSuccess: data => {
const response: UploadResponse = data.response ?? {};
if (response?.Error) {
notifyError(response.Error.Message);
return;
}
options.fileDone?.(response, data.batch?.filePaths?.[0], data);
},
input: uploadInput.getNode() as HTMLInputElement,
dropZone: options.zone,
batchStart: () => {
Expand Down

0 comments on commit f61bb96

Please # to comment.