From 5003819545860834e6a4bb8a990b91ba2eae45c9 Mon Sep 17 00:00:00 2001 From: Hayato Shishido Date: Fri, 21 Oct 2022 23:10:22 +0900 Subject: [PATCH] fix the way api course updates --- src/infrastructure/api/converters/registeredCourse.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/infrastructure/api/converters/registeredCourse.ts b/src/infrastructure/api/converters/registeredCourse.ts index 902d7525..2487ffea 100644 --- a/src/infrastructure/api/converters/registeredCourse.ts +++ b/src/infrastructure/api/converters/registeredCourse.ts @@ -60,8 +60,12 @@ const updateApiCourseProp = < v2: Required[P] ) => boolean ): void => { - if (apiCourse.course && compareFn(apiCourse.course[prop], newValue)) return; - apiCourse[prop] = newValue; + if ( + prop in apiCourse || + (apiCourse.course && !compareFn(apiCourse.course[prop], newValue)) + ) { + apiCourse[prop] = newValue; + } }; /**