2016-10-28 16:07:50 +03:00
|
|
|
import {isEmpty} from 'ember-utils';
|
|
|
|
|
|
|
|
export default function mockConfiguration(server) {
|
2017-01-02 21:49:44 +03:00
|
|
|
server.get('/configuration/', function ({db}) {
|
2016-10-28 16:07:50 +03:00
|
|
|
if (isEmpty(db.configurations)) {
|
|
|
|
server.loadFixtures('configurations');
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
configuration: [db.configurations.find(1)]
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
2017-01-02 21:49:44 +03:00
|
|
|
server.get('/configuration/timezones/', function ({db}) {
|
|
|
|
if (isEmpty(db.timezones)) {
|
|
|
|
server.loadFixtures('timezones');
|
|
|
|
}
|
|
|
|
|
2016-10-28 16:07:50 +03:00
|
|
|
return {
|
|
|
|
configuration: [{
|
|
|
|
timezones: db.timezones
|
|
|
|
}]
|
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|