Ghost/ghost/admin/mirage/config/members.js
Kevin Ansfield d0a834b477 🐛 Fixed missing error notification when attempting to activate an invalid theme
no issue
- updates error handling to work with new v2 error response formats
  - `.errorType` -> `.error`
  - `.errorDetails` -> `.details`
2019-03-25 11:32:29 +00:00

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/');
}