From 4d4b73767ff7beab703333ded67c8b204f937fb2 Mon Sep 17 00:00:00 2001 From: katherinehhh Date: Tue, 14 Nov 2023 09:36:00 +0800 Subject: [PATCH] fix: attachment field in m2m association field report error whwen setting required (#3031) --- .../core/client/src/schema-component/antd/upload/shared.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/core/client/src/schema-component/antd/upload/shared.ts b/packages/core/client/src/schema-component/antd/upload/shared.ts index a283a5e94..3239d05a0 100644 --- a/packages/core/client/src/schema-component/antd/upload/shared.ts +++ b/packages/core/client/src/schema-component/antd/upload/shared.ts @@ -185,6 +185,7 @@ export function useUploadProps({ 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) => {