fix item update endpoint

This commit is contained in:
j3d1 2019-12-19 16:22:57 +01:00
parent 2e5377cca7
commit dcc9e87dad

View file

@ -52,10 +52,9 @@ class ItemController extends Controller
public function update($event, $id, Request $request) public function update($event, $id, Request $request)
{ {
$eid = Event::where('slug','=',$event)->first()->eid; $eid = Event::where('slug', $event)->first()->eid;
$item = Item::findOrFail($id); $item = Item::where('eid', $eid)->where('item_uid', $id)->first();
$item->update($request->all()); $item->update($request->except(['file','box']));
return response()->json($item, 200); return response()->json($item, 200);
} }