From ecc1b288015759efbf98ee6e5aadc581d03ce02b Mon Sep 17 00:00:00 2001 From: jedi Date: Thu, 19 Dec 2019 22:15:42 +0100 Subject: [PATCH] fix item delete endpoint --- app/Http/Controllers/ItemController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/ItemController.php b/app/Http/Controllers/ItemController.php index 6455fd2..794b7d8 100644 --- a/app/Http/Controllers/ItemController.php +++ b/app/Http/Controllers/ItemController.php @@ -61,7 +61,7 @@ class ItemController extends Controller public function delete($event, $id) { $eid = Event::where('slug','=',$event)->first()->eid; - Item::findOrFail($id)->delete(); + Item::where('eid', $eid)->where('item_uid', $id)->first()->delete(); return response()->json(array("satus"=>'Deleted Successfully'), 200); } }