mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 13:54:35 +03:00
35860fad70
no issue - replaced timezones endpoint with `@tryghost/timezone-data` module
25 lines
784 B
JavaScript
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)
|
|
};
|
|
});
|
|
}
|