Convert null to NotFoundError for remoting call to DataAccessObject.findOne.

This commit is contained in:
Alberto Leal 2014-06-11 16:59:21 -03:00
parent c355c99cbd
commit 4fd3c969f9
1 changed files with 12 additions and 11 deletions

View File

@ -767,7 +767,8 @@ setRemoting(DataAccessObject.findOne, {
description: 'Find first instance of the model matched by filter from the data source', description: 'Find first instance of the model matched by filter from the data source',
accepts: {arg: 'filter', type: 'object', description: 'Filter defining fields, where, orderBy, offset, and limit'}, accepts: {arg: 'filter', type: 'object', description: 'Filter defining fields, where, orderBy, offset, and limit'},
returns: {arg: 'data', type: 'object', root: true}, returns: {arg: 'data', type: 'object', root: true},
http: {verb: 'get', path: '/findOne'} http: {verb: 'get', path: '/findOne'},
rest: {after: convertNullToNotFoundError}
}); });
/** /**