mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 13:54:35 +03:00
d0a834b477
no issue - updates error handling to work with new v2 error response formats - `.errorType` -> `.error` - `.errorDetails` -> `.details`
20 lines
510 B
JavaScript
20 lines
510 B
JavaScript
import {paginatedResponse} from '../utils';
|
|
|
|
export default function mockMembers(server) {
|
|
server.get('/members/', paginatedResponse('members'));
|
|
|
|
server.get('/members/:id/', function ({members}, {params}) {
|
|
let {id} = params;
|
|
let member = members.find(id);
|
|
|
|
return member || new Response(404, {}, {
|
|
errors: [{
|
|
type: 'NotFoundError',
|
|
message: 'Member not found.'
|
|
}]
|
|
});
|
|
});
|
|
|
|
server.del('/members/:id/');
|
|
}
|