Skip to content

Commit

Permalink
fix backend tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuck McAndrew committed Feb 12, 2021
1 parent e36740b commit bb5db6a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/routes/files/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const createFileMetaData = async (
originalFileName,
attachmentType,
key: s3FileName,
status: 'UPLOADING',
status: fileStatuses.uploading,
fileSize,
};
let file;
Expand Down Expand Up @@ -131,9 +131,10 @@ export default async function uploadHandler(req, res) {
}
try {
await addToScanQueue({ key: metadata.key });
await updateStatus(metadata.id, fileStatuses.scanning);
} catch (err) {
if (metadata) {
await updateStatus(metadata.id, fileStatuses.rejected);
await updateStatus(metadata.id, fileStatuses.uploaded);
}
await handleErrors(req, res, err, logContext);
}
Expand Down

0 comments on commit bb5db6a

Please sign in to comment.