Fix some exceptions after server refactoring

pull/54/merge
Candid Dauth 2016-10-30 18:05:23 +03:00
rodzic 3d6c169bc8
commit 1ff7e03d01
1 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

@ -94,7 +94,9 @@ module.exports = function(Database) {
getLineTemplate(padId, data) {
return utils.promiseAuto({
lineTemplate: () => {
return JSON.parse(JSON.stringify(this._conn.model("Line").build(utils.extend({ }, data, { padId: padId, data: data.data || { } }))));
var ret = JSON.parse(JSON.stringify(this._conn.model("Line").build(utils.extend({ }, data, { padId: padId }))));
ret.data = data.data || { };
return ret;
},
type: this.getType(padId, data.typeId),
@ -219,7 +221,7 @@ module.exports = function(Database) {
}).then((res) => {
this.emit("deleteLine", padId, { id: lineId });
return data;
return res.line;
});
},