1
0
Fork 0
sortable-recipes/ember-ui-modern/app/adapters/meal.js
2020-03-02 09:26:23 -06:00

15 lines
422 B
JavaScript

import ApplicationAdapter from './application';
export default class MealAdapter extends ApplicationAdapter {
async findRecord(store, model, id) {
let result = await fetch(`${this.host}meal/${id}`);
return await result.json();
}
async queryRecord(store, model, query) {
if (query === 'random') {
let result = await fetch(`${this.host}meals/random`);
return await result.json();
}
}
}