do not redefine vars
This commit is contained in:
@@ -157,10 +157,10 @@ TemplateMapsController.prototype.retrieve = function(req, res) {
|
||||
tpl_id = req.params.template_id.split('@');
|
||||
if ( tpl_id.length > 1 ) {
|
||||
if ( tpl_id[0] != cdbuser ) {
|
||||
var err = new Error("Cannot get template id '" + req.params.template_id + "' for user '" + cdbuser +
|
||||
"'");
|
||||
err.http_status = 404;
|
||||
throw err;
|
||||
var templateNotFoundErr = new Error("Cannot get template id '" + req.params.template_id +
|
||||
"' for user '" + cdbuser + "'");
|
||||
templateNotFoundErr.http_status = 404;
|
||||
throw templateNotFoundErr;
|
||||
}
|
||||
tpl_id = tpl_id[1];
|
||||
}
|
||||
@@ -219,10 +219,10 @@ TemplateMapsController.prototype.destroy = function(req, res) {
|
||||
tpl_id = req.params.template_id.split('@');
|
||||
if ( tpl_id.length > 1 ) {
|
||||
if ( tpl_id[0] != cdbuser ) {
|
||||
var err = new Error("Cannot find template id '" + req.params.template_id + "' for user '" +
|
||||
cdbuser + "'");
|
||||
err.http_status = 404;
|
||||
throw err;
|
||||
var templateNotFoundErr = new Error("Cannot find template id '" + req.params.template_id +
|
||||
"' for user '" + cdbuser + "'");
|
||||
templateNotFoundErr.http_status = 404;
|
||||
throw templateNotFoundErr;
|
||||
}
|
||||
tpl_id = tpl_id[1];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user