Ghost/ghost/admin/mirage/config/config.js
Kevin Ansfield 35860fad70 Removed usage of /configuration/timezones/ endpoint
no issue
- replaced timezones endpoint with `@tryghost/timezone-data` module
2019-02-26 12:37:50 +07:00

25 lines
784 B
JavaScript

import {Response} from 'ember-cli-mirage';
import {isEmpty} from '@ember/utils';
export default function mockConfig(server) {
server.get('/config/', function ({db}, request) {
if (!request.requestHeaders.Authorization) {
return new Response(403, {}, {
errors: [{
type: 'NoPermissionError',
message: 'Authorization failed',
context: 'Unable to determine the authenticated user or integration. Check that cookies are being passed through if using session authentication.'
}]
});
}
if (isEmpty(db.configs)) {
server.loadFixtures('configs');
}
return {
config: db.configs.find(1)
};
});
}