From 65f091ba5bf78df6ff0ecb461e7df1be9d0f6527 Mon Sep 17 00:00:00 2001 From: ayu Date: Wed, 30 Jun 2021 12:27:09 +0530 Subject: [PATCH] Update update-record-factory.ts When we are not editing the images and multiple option is on, it should not try to update them --- src/features/upload-file/factories/update-record-factory.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/upload-file/factories/update-record-factory.ts b/src/features/upload-file/factories/update-record-factory.ts index 8f63f39..d684baa 100644 --- a/src/features/upload-file/factories/update-record-factory.ts +++ b/src/features/upload-file/factories/update-record-factory.ts @@ -60,7 +60,7 @@ export const updateRecordFactory = ( await record.update(newParams) } - if (multiple && files) { + if (multiple && files && files.length) { const uploadedFiles = files as Array const keys = await Promise.all(uploadedFiles.map(async (uploadedFile) => {