mirror of https://gitee.com/bigwinds/arangodb
Added 404 response to PUT/PATCH/GET templates.
This commit is contained in:
parent
802add169f
commit
86015dba97
|
@ -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 %>
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue