also return container and file information through items endpoint

This commit is contained in:
j3d1 2019-12-05 13:05:44 +01:00
parent b978b2bc0b
commit 6f7dbddf92

View file

@ -17,13 +17,15 @@ class ItemController extends Controller
public function showByEvent($event)
{
$eid = Event::where('slug','=',$event)->first()->eid;
return response()->json(Item::where('eid','=',$eid)->get());
return response()->json(Item::where('eid','=',$eid)
->join('containers','item.cid','=','container.cid')
->leftJoin('files','item.iid','=','files.iid')
->get());
}
public function searchByEvent($event, $query)
{
$eid = Event::where('slug','=',$event)->first()->eid;
return response()->json(Item::where('eid','=',$eid)->get()); //TODO actually search
return showByEvent($event); //TODO actually search
}
public function showOneItem($event, $id)