Skip to content

Commit

Permalink
Fixed dataset error upload bug (#779)
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidQuartz authored Feb 2, 2022
1 parent 588cd6a commit 05f41c9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions geonode_mapstore_client/client/js/routes/UploadDataset.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,17 +196,17 @@ function UploadList({
}))
.then((responses) => {
const successfulUploads = responses.filter(({ status }) => status === 'success');
const failedUploads = responses.filter(({ status }) => status === 'error');
if (failedUploads.length > 0) {
const failed = failedUploads.map(({ baseName: name, error }) => ({
const errorUploads = responses.filter(({ status }) => status === 'error');
if (errorUploads.length > 0) {
const failedUploads = errorUploads.map(({ baseName: name, error }) => ({
id: uuidv1(),
name,
progress: 100,
state: 'INVALID',
create_date: Date.now(),
error
}));
onSuccess(failed);
onSuccess(failedUploads);
}
if (successfulUploads.length > 0) {
const successfulUploadsIds = successfulUploads.map(({ data }) => data?.id);
Expand Down Expand Up @@ -356,7 +356,7 @@ function UploadDataset({

return (
<UploadList
onSuccess={(successfulUploads) => setPendingUploads(parseUploadResponse([...successfulUploads, ...pendingUploads]))}
onSuccess={(successfulUploads) => setPendingUploads((prevUploads) => parseUploadResponse([...successfulUploads, ...prevUploads]))}
>
<ProcessingUploadList
uploads={pendingUploads}
Expand Down

0 comments on commit 05f41c9

Please sign in to comment.