2017-08-22 10:53:26 +03:00
|
|
|
import {isEmpty} from '@ember/utils';
|
2016-10-28 16:07:50 +03:00
|
|
|
|
2019-02-25 17:47:17 +03:00
|
|
|
export default function mockConfig(server) {
|
2019-08-12 11:11:10 +03:00
|
|
|
server.get('/config/', function ({db}) {
|
2019-02-25 17:47:17 +03:00
|
|
|
if (isEmpty(db.configs)) {
|
|
|
|
server.loadFixtures('configs');
|
2016-10-28 16:07:50 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
2019-02-25 17:47:17 +03:00
|
|
|
config: db.configs.find(1)
|
2016-10-28 16:07:50 +03:00
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|