From 56725e563c4f1d0381c5d0f3793757cfa0cdec79 Mon Sep 17 00:00:00 2001 From: William Brawner Date: Sat, 7 Mar 2020 19:49:05 -0600 Subject: [PATCH] Fix some issues with BudgetController Signed-off-by: William Brawner --- lib/Controller/BudgetController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Controller/BudgetController.php b/lib/Controller/BudgetController.php index 1ee77d7..2beadd1 100644 --- a/lib/Controller/BudgetController.php +++ b/lib/Controller/BudgetController.php @@ -67,7 +67,7 @@ class BudgetController extends Controller { try { $userPermission = $this->userPermissionMapper->find($id, $this->userId); - return new DataResponse($this->budgetMapper->find($userPermission->budgetId)); + return new DataResponse($this->budgetMapper->find($userPermission->getBudgetId())); } catch (Exception $e) { return new DataResponse([], Http::STATUS_NOT_FOUND); } @@ -94,7 +94,7 @@ class BudgetController extends Controller $userPermission->setBudgetId($budget->getId()); $userPermission->setUserId($user); $userPermission->setPermission($permission); - $userPermission = $this->userPermissionMapper->save($userPermission); + $userPermission = $this->userPermissionMapper->insert($userPermission); array_push($userPermissions, $userPermission); } $budget->setUsers($userPermissions);