kopia lustrzana https://github.com/FacilMap/facilmap
Fix "Pad could not be found" error when saving settings without change
rodzic
b441169646
commit
dfe404fefb
|
@ -135,12 +135,11 @@ module.exports = function(Database) {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
update: (validateRead, validateWrite, validateAdmin) => {
|
update: (oldData, validateRead, validateWrite, validateAdmin) => {
|
||||||
return this._conn.model("Pad").update(data, { where: { id: padId } }).then(res => {
|
if(!oldData)
|
||||||
if(res[0] == 0)
|
|
||||||
throw new Error("Pad " + padId + " could not be found.");
|
throw new Error("Pad " + padId + " could not be found.");
|
||||||
return res;
|
|
||||||
});
|
return this._conn.model("Pad").update(data, { where: { id: padId } });
|
||||||
},
|
},
|
||||||
|
|
||||||
newData: (update) => this.getPadData(data.id || padId),
|
newData: (update) => this.getPadData(data.id || padId),
|
||||||
|
|
Ładowanie…
Reference in New Issue