fix: attachment field in m2m association field report error whwen setting required (#3031)

This commit is contained in:
katherinehhh 2023-11-14 09:36:00 +08:00 committed by GitHub
parent 13be8d012f
commit 4d4b73767f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -185,6 +185,7 @@ export function useUploadProps<T extends IUploadProps = UploadProps>({ serviceEr
});
}
formData.append(filename, file);
// eslint-disable-next-line promise/catch-or-return
api.axios
.post(action, formData, {
withCredentials,
@ -227,7 +228,7 @@ export const toItem = (file) => {
};
export const toFileList = (fileList: any) => {
return toArr(fileList).map(toItem);
return toArr(fileList?.filter(Boolean)).map(toItem);
};
export const toValue = (fileList: any) => {