Fix JSON parse issue when syncing recipe data
This commit is contained in:
parent
4aa3739c9a
commit
f3dfb8ddf8
@ -108,8 +108,8 @@ export default function PhotoForm({
|
|||||||
let a = currentForm[key];
|
let a = currentForm[key];
|
||||||
let b = value;
|
let b = value;
|
||||||
if (FIELDS_WITH_JSON.includes(key)) {
|
if (FIELDS_WITH_JSON.includes(key)) {
|
||||||
a = JSON.parse(a ?? '');
|
a = a ? JSON.parse(a) : undefined;
|
||||||
b = JSON.parse(b ?? '');
|
b = b ? JSON.parse(b) : undefined;
|
||||||
}
|
}
|
||||||
if (!deepEqual(a, b)) {
|
if (!deepEqual(a, b)) {
|
||||||
changedKeys.push(key as keyof PhotoFormData);
|
changedKeys.push(key as keyof PhotoFormData);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user