Set 404 as defautl status code and set the proper status code fir the response at very same time that the response body
This commit is contained in:
@@ -115,6 +115,7 @@ function createTemplate ({ templateMaps }) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
res.statusCode = 200;
|
||||
res.body = { template_id: templateId };
|
||||
|
||||
next();
|
||||
@@ -133,6 +134,7 @@ function updateTemplate ({ templateMaps }) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
res.statusCode = 200;
|
||||
res.body = { template_id: templateId };
|
||||
|
||||
next();
|
||||
@@ -161,6 +163,7 @@ function retrieveTemplate ({ templateMaps }) {
|
||||
// so we remove it before returning to the user
|
||||
delete template.auth_id;
|
||||
|
||||
res.statusCode = 200;
|
||||
res.body = { template };
|
||||
|
||||
next();
|
||||
@@ -199,6 +202,7 @@ function listTemplates ({ templateMaps }) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
res.statusCode = 200;
|
||||
res.body = { template_ids: templateIds };
|
||||
|
||||
next();
|
||||
|
||||
Reference in New Issue
Block a user