revert INVALID_FILE_TYPE error change

This commit is contained in:
Abhinav 2023-01-31 11:23:04 +05:30
parent 564b822dbf
commit 62a6b5963b
2 changed files with 5 additions and 2 deletions

View file

@ -60,7 +60,11 @@ export async function getFileType(
fileFormat,
});
}
throw Error(CustomError.INVALID_FILE_TYPE(fileFormat));
return {
fileType: FILE_TYPE.OTHERS,
exactType: fileFormat,
mimeType: receivedFile instanceof File ? receivedFile.type : null,
};
}
}

View file

@ -49,7 +49,6 @@ export const CustomError = {
HIDDEN_COLLECTION_SYNC_FILE_ATTEMPTED:
'hidden collection sync file attempted',
UNKNOWN_ERROR: 'Something went wrong, please try again',
INVALID_FILE_TYPE: (type: string) => `invalid file type- ${type}`,
};
function parseUploadErrorCodes(error) {