From 1ff7e03d015a43d3ed4e7b9e6e54a88ac6b2ef74 Mon Sep 17 00:00:00 2001 From: Candid Dauth Date: Sun, 30 Oct 2016 18:05:23 +0300 Subject: [PATCH] Fix some exceptions after server refactoring --- server/database/line.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/database/line.js b/server/database/line.js index 5c3f6268..d12886ff 100644 --- a/server/database/line.js +++ b/server/database/line.js @@ -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; }); },