Ghost/ghost/admin/mirage/config/offers.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

22 lines
534 B
JavaScript

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