From 462723ec087f91555e1c26d80972437cef2ab468 Mon Sep 17 00:00:00 2001 From: Dawid Tarasiuk Date: Wed, 23 Jun 2021 13:21:13 +0200 Subject: [PATCH] Fix product update with file attribute (#1190) * Fix product update with file attribute * Update changelog * Fix optional chaining --- CHANGELOG.md | 1 + src/attributes/utils/handlers.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4b4e176c..95d1876b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,7 @@ All notable, unreleased changes to this project will be documented in this file. - Fix product type translations - #1163 by @orzechdev - Support staff only voucher - #1174 by @orzechdev - Fix label names in reference attributes - #1184 by @orzechdev +- Fix failing product update with file attribute - #1190 by @orzechdev # 2.11.1 diff --git a/src/attributes/utils/handlers.ts b/src/attributes/utils/handlers.ts index b2fd8f99f..b6800c05f 100644 --- a/src/attributes/utils/handlers.ts +++ b/src/attributes/utils/handlers.ts @@ -192,8 +192,8 @@ function getFileInput( }; } return { - file: updatedFileAttribute.file, - id: updatedFileAttribute.id + file: attribute.data.selectedValues?.[0]?.file?.url, + id: attribute.id }; }