mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim-api.git
synced 2026-08-19 12:34:06 +00:00
fetching branchname and popup
This commit is contained in:
@@ -11,7 +11,8 @@ class DeliveryinfoController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$deliveryinfo = Deliveryinfo::where('com_id', Auth::user()->company())->get();
|
||||
$com_id = Auth::user()->company()->first()->id;
|
||||
$deliveryinfo = Deliveryinfo::where('com_id', $com_id)->get();
|
||||
return response()->json($deliveryinfo, 200);
|
||||
}
|
||||
|
||||
@@ -23,7 +24,9 @@ class DeliveryinfoController extends Controller
|
||||
*/
|
||||
public function show(Deliveryinfo $id)
|
||||
{
|
||||
$deliveryinfo = Deliveryinfo::where('com_id', Auth::user()->company())->where('id', $id)->firstOrFail();
|
||||
// TODO : make user company not array
|
||||
$com_id = Auth::user()->company()->get()[0]['id'];
|
||||
$deliveryinfo = Deliveryinfo::where('com_id', $com_id)->where('id', $id)->firstOrFail();
|
||||
return response()->json($deliveryinfo, 200);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user