fix: Fixed the issue where the error message was not displayed when uploading a file that was too large #1782 (#2654)

### What problem does this PR solve?

_Briefly describe what this PR aims to solve. Include background context
that will help reviewers understand the purpose of the PR._

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
- [ ] New Feature (non-breaking change which adds functionality)
- [ ] Documentation Update
- [ ] Refactoring
- [ ] Performance Improvement
- [ ] Other (please describe):
This commit is contained in:
balibabu
2024-09-29 15:22:05 +08:00
committed by GitHub
parent 01db00b587
commit d3b37b0b70
2 changed files with 7 additions and 7 deletions

View File

@ -208,13 +208,13 @@ export const useUploadFile = () => {
formData.append('path', pathList[index]);
});
try {
const { data } = await fileManagerService.uploadFile(formData);
if (data.retcode === 0) {
const ret = await fileManagerService.uploadFile(formData);
if (ret?.data.retcode === 0) {
message.success(t('message.uploaded'));
setPaginationParams(1);
queryClient.invalidateQueries({ queryKey: ['fetchFileList'] });
}
return data.retcode;
return ret?.data?.retcode;
} catch (error) {
console.log('🚀 ~ useUploadFile ~ error:', error);
}