1
0
Fork 0

Added 404 response to PUT/PATCH/GET templates.

This commit is contained in:
Alan Plum 2015-05-28 14:52:17 +02:00
parent 802add169f
commit 86015dba97
1 changed files with 6 additions and 3 deletions

View File

@ -49,7 +49,8 @@ controller.get('/:id', function (req, res) {
var id = req.urlParameters.id;
res.json(<%= repositoryInstance %>.byId(id).forClient());
})
.pathParam('id', <%= modelInstance %>IdSchema);
.pathParam('id', <%= modelInstance %>IdSchema)
.errorResponse(ArangoError, 404, 'The <%= modelInstance %> could not be found');
/** Replaces a <%= modelInstance %>
*
@ -65,7 +66,8 @@ controller.put('/:id', function (req, res) {
.bodyParam('<%= modelInstance %>', {
description: 'The <%= modelInstance %> you want your old one to be replaced with',
type: <%= model %>
});
})
.errorResponse(ArangoError, 404, 'The <%= modelInstance %> could not be found');
/** Updates a <%= modelInstance %>
*
@ -81,7 +83,8 @@ controller.patch('/:id', function (req, res) {
.bodyParam('patch', {
description: 'The patch data you want your <%= modelInstance %> to be updated with',
type: joi.object().required()
});
})
.errorResponse(ArangoError, 404, 'The <%= modelInstance %> could not be found');
/** Removes a <%= modelInstance %>
*