Skip to content

Commit

Permalink
Merge pull request #177 from julianpoy/bug/#176-cant-delete-meal-plan
Browse files Browse the repository at this point in the history
Bug/#176 Fix meal plan delete button
  • Loading branch information
julianpoy authored Mar 3, 2019
2 parents 83b459b + 096b087 commit cfcc278
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Backend/routes/mealPlans.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ router.delete(
res.status(404).send("Meal plan not found or not visible to you!");
} else {
if (mealPlan.userId === res.locals.session.userId) {
return mealPlan.destroy(function () {
return mealPlan.destroy().then(() => {
for (var i = 0; i < (mealPlan.collaborators || []).length; i++) {
GripService.broadcast(mealPlan.collaborators[i], 'mealPlan:removed', {
mealPlanId: mealPlan.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
- Recipe bulk actions: press and hold a recipe for actions on multiple recipes at once<br />
- New iconography for menus<br />
- Better client-side error handling<br />
- Fixed a bug that caused the meal plan delete button to be broken<br />

<br />

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams, ToastController, ViewController, AlertController } from 'ionic-angular';
import { LoadingServiceProvider } from '../../../providers/loading-service/loading-service';
import { ShoppingListServiceProvider } from '../../../providers/shopping-list-service/shopping-list-service';
import { MealPlanServiceProvider } from '../../../providers/meal-plan-service/meal-plan-service';
import { UtilServiceProvider } from '../../../providers/util-service/util-service';

@IonicPage({
Expand All @@ -22,7 +22,7 @@ export class MealPlanPopoverPage {
public navParams: NavParams,
public utilService: UtilServiceProvider,
public loadingService: LoadingServiceProvider,
public shoppingListService: ShoppingListServiceProvider,
public mealPlanService: MealPlanServiceProvider,
public toastCtrl: ToastController,
public viewCtrl: ViewController,
public alertCtrl: AlertController
Expand Down Expand Up @@ -67,7 +67,7 @@ export class MealPlanPopoverPage {
_deleteMealPlan() {
var loading = this.loadingService.start();

this.shoppingListService.unlink({
this.mealPlanService.unlink({
id: this.mealPlanId
}).subscribe(() => {
loading.dismiss();
Expand Down

0 comments on commit cfcc278

Please sign in to comment.