fix(medusa): has-changes (#4023)

* fix(medusa): has-changes

* add changeset
This commit is contained in:
Derek Wene
2023-05-05 04:05:20 -05:00
committed by GitHub
parent afd79c9c39
commit bd53adb238
2 changed files with 9 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
"@medusajs/medusa": patch
---
fix(variant-update): hasChanges function incorrectly calculates if there are changes

View File

@@ -11,7 +11,10 @@ export function hasChanges<T1 extends Object, T2 extends Object>(
): boolean {
for (const [key, value] of Object.entries(obj2)) {
if (isObject(obj1[key])) {
return hasChanges(obj1[key], value)
if (hasChanges(obj1[key], value)) {
return true
}
continue
}
if (obj1[key] !== value) {