Ghost/ghost/admin/mirage/config/labels.js
Kevin Ansfield 36ba447de0 Fixed mirage setup for members
refs 2bf311edc8

- added missing relationship definitions for included relationships on member model
- cleaned up unnecessary forcing of `id: 99` when creating new records of some models
2022-02-23 14:21:28 +00:00

23 lines
562 B
JavaScript

import {paginatedResponse} from '../utils';
export default function mockLabels(server) {
server.post('/labels/');
server.get('/labels/', paginatedResponse('labels'));
server.get('/labels/:id/', function ({labels}, {params}) {
let {id} = params;
let label = labels.find(id);
return label || new Response(404, {}, {
errors: [{
type: 'NotFoundError',
message: 'Label not found.'
}]
});
});
server.put('/labels/:id/');
server.del('/labels/:id/');
}