|
|
|
@@ -17,8 +17,10 @@ export class OutletService { |
|
|
|
this.fetchOutlets(); |
|
|
|
} |
|
|
|
|
|
|
|
private async getDenormalizedOutlet(outlet: Outlet) { |
|
|
|
const offers = await Promise.all(outlet.offers.map(offer_id => this.offerService.getOfferByID(offer_id))); |
|
|
|
private getDenormalizedOutlet = async (outlet: Outlet) => { |
|
|
|
const offers = await Promise.all(outlet.offers.map(offer_id => { |
|
|
|
return this.offerService.getOfferByID(offer_id); |
|
|
|
})); |
|
|
|
const menu_items = await Promise.all(outlet.menu_items.map(menu_item_id => this.menuItemService.getMenuItemByID(menu_item_id))); |
|
|
|
|
|
|
|
return { |
|
|
|
@@ -33,6 +35,7 @@ export class OutletService { |
|
|
|
} |
|
|
|
|
|
|
|
public async getOutletByID(id: string) { |
|
|
|
await this.fetchOutlets(); |
|
|
|
return this.outlets.find((outlet) => outlet.id === id); |
|
|
|
} |
|
|
|
} |