From 56fedc6ee9fa7af6a77497d614a446170b17eedb Mon Sep 17 00:00:00 2001 From: Brenton Durkee Date: Tue, 17 Oct 2017 19:16:19 -0400 Subject: [PATCH] Fix lint errors --- lib/models/templates.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/models/templates.js b/lib/models/templates.js index 9bebb5b2..b0f0099e 100644 --- a/lib/models/templates.js +++ b/lib/models/templates.js @@ -139,15 +139,16 @@ module.exports.update = (id, updates, callback) => { }); }; -module.exports.duplicate = (id, callback) => { - return this.get(id, (err, template) => { - if (!template) { - return callback(new Error(_('Template does not exist'))); - } - template.name = template.name + ' Copy'; - return this.create(template, callback); - }); -} +module.exports.duplicate = (id, callback) => module.exports.get(id, (err, template) => { + if (err) { + return callback(err); + } + if (!template) { + return callback(new Error(_('Template does not exist'))); + } + template.name = template.name + ' Copy'; + return module.exports.create(template, callback); +}); module.exports.delete = (id, callback) => { id = Number(id) || 0;