mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-29 17:34:25 +00:00
WIP - Order steps & remaining APIs
This commit is contained in:
@@ -62,25 +62,15 @@ class UpdateScheduleLogic extends AbstractControllerLogic
|
||||
*/
|
||||
public function logic(Request $request) : JsonResponse
|
||||
{
|
||||
try {
|
||||
$object = new ScheduleObject($request->input('etd'), $request->input('eta'));
|
||||
|
||||
$district = $this->fetchesDistrict->execute(['id' => $request->input('district_id')]);
|
||||
$object = new ScheduleObject($request->input('street_one'), $request->input('street_two'), $district->country_id, $district->state_id, $district->id, $request->input('post_code'));
|
||||
//$object = new ScheduleObject($request->input('company_id'), $request->input('street_one'), $request->input('street_two'), $request->input('city'), $request->input('state'), $request->input('post_code'), $request->input('country'), $request->input('default'), $request->input('billing'));
|
||||
$this->canUpdateSchedule->passes($object);
|
||||
|
||||
$this->canUpdateSchedule->passes($object);
|
||||
$query = $this->fetchesSchedule->execute(['id' => $request->route('id')]);
|
||||
|
||||
$query = $this->fetchesSchedule->execute(['id' => $request->route('id')]);
|
||||
|
||||
$query = $this->updatesSchedule->execute($query, $object);
|
||||
|
||||
return $this->resourceResponse(new ScheduleResource($query));
|
||||
|
||||
|
||||
} catch (\Exception $exception){
|
||||
throw new ErrorException($exception->getMessage(), $exception->getCode());
|
||||
}
|
||||
$query = $this->updatesSchedule->execute($query, $object);
|
||||
|
||||
return $this->resourceResponse(new ScheduleResource($query));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user