Commit 3945371a authored by Florent Chehab's avatar Florent Chehab
Browse files

Fix presave comparaison check

parent 42dbc13a
......@@ -67,8 +67,17 @@ class Editor extends MyComponent {
hasChangesToSave(formData, modelData) {
for (let fieldKey in formData) {
if (formData[fieldKey] != modelData[fieldKey]) {
// console.log(fieldKey, formData[fieldKey], modelData[fieldKey]);
let cmp1 = formData[fieldKey];
let cmp2 = modelData[fieldKey];
if (typeof cmp1 == 'object') {
cmp1 = JSON.stringify(cmp1);
cmp2 = JSON.stringify(cmp2)
}
if (cmp1 != cmp2) {
console.log(fieldKey, cmp1, cmp2);
return true;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment