mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 11:22:19 +03:00
36ba447de0
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
23 lines
562 B
JavaScript
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/');
|
|
}
|