diff --git a/src/app/restaurants/restaurants.component.html b/src/app/restaurants/restaurants.component.html
index ba74281..d8e57fb 100644
--- a/src/app/restaurants/restaurants.component.html
+++ b/src/app/restaurants/restaurants.component.html
@@ -1,6 +1,6 @@
Restaurants
-
-
+
+
diff --git a/src/app/restaurants/restaurants.component.ts b/src/app/restaurants/restaurants.component.ts
index 25ca122..7a371b8 100644
--- a/src/app/restaurants/restaurants.component.ts
+++ b/src/app/restaurants/restaurants.component.ts
@@ -19,12 +19,6 @@ export class RestaurantsComponent implements OnInit {
this.getTodayOnly();
}
- getAllDays(): void {
- this.lunchService.getRestaurants().subscribe( restaurants => {
- this.restaurants = restaurants;
- });
- }
-
getTodayOnly(): void {
const d = new Date();
const dayName = this.days[d.getDay()];
@@ -33,4 +27,22 @@ export class RestaurantsComponent implements OnInit {
});
}
+ getTodayOnlyUpdate(): void {
+ const d = new Date();
+ const dayName = this.days[d.getDay()];
+ this.lunchService.getRestaurantsForDay(dayName).subscribe( restaurants => {
+ for (let i = 0; i < restaurants.length; i++) {
+ this.restaurants[i].menus = restaurants[i].menus;
+ }
+ });
+ }
+
+ getAllDaysUpdate(): void {
+ this.lunchService.getRestaurants().subscribe( restaurants => {
+ for (let i = 0; i < restaurants.length; i++) {
+ this.restaurants[i].menus = restaurants[i].menus;
+ }
+ });
+ }
+
}
diff --git a/src/app/services/lunch/lunch.service.ts b/src/app/services/lunch/lunch.service.ts
index da96f4f..57f7e98 100644
--- a/src/app/services/lunch/lunch.service.ts
+++ b/src/app/services/lunch/lunch.service.ts
@@ -20,7 +20,7 @@ export class LunchService {
private restaurantAdapter: RestaurantAdapter,
private menuAdapter: MenuAdapter,
private mealAdapter: MealAdapter) {
- this.serviceUri = 'http://localhost:1984/';
+ this.serviceUri = 'https://lunch.zvon.tech:1985/';
this.getUri = 'get';
this.getRestaurantParam = 'restaurant';
this.getDayParam = 'day';