Fix lint errors
This commit is contained in:
parent
0cbec006b4
commit
56fedc6ee9
1 changed files with 10 additions and 9 deletions
|
@ -139,15 +139,16 @@ module.exports.update = (id, updates, callback) => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports.duplicate = (id, callback) => {
|
module.exports.duplicate = (id, callback) => module.exports.get(id, (err, template) => {
|
||||||
return this.get(id, (err, template) => {
|
if (err) {
|
||||||
|
return callback(err);
|
||||||
|
}
|
||||||
if (!template) {
|
if (!template) {
|
||||||
return callback(new Error(_('Template does not exist')));
|
return callback(new Error(_('Template does not exist')));
|
||||||
}
|
}
|
||||||
template.name = template.name + ' Copy';
|
template.name = template.name + ' Copy';
|
||||||
return this.create(template, callback);
|
return module.exports.create(template, callback);
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
module.exports.delete = (id, callback) => {
|
module.exports.delete = (id, callback) => {
|
||||||
id = Number(id) || 0;
|
id = Number(id) || 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue