Skip to content

Commit

Permalink
Minor fix for location aware resources
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Poyigi <[email protected]>
  • Loading branch information
sampoyigi committed Aug 28, 2022
1 parent 29c60f0 commit 75ac21b
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions apiresources/Orders.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@ class Orders extends ApiController

protected $requiredAbilities = ['orders:*'];

public function restExtendQuery($query)
{
if (($token = $this->getToken()) && $token->isForCustomer())
$query->where('customer_id', $token->tokenable_id);

return $query;
}

public function restAfterSave($model)
{
if ($orderMenus = (array)request()->input('order_menus', [])) {
Expand All @@ -53,6 +45,9 @@ public function restAfterSave($model)
$model->addOrderTotals(json_decode(json_encode($orderTotals), true));

if ($orderStatus = request()->input('status_id', false))
$model->updateOrderStatus($orderStatus, ['comment' => request()->input('status_comment', null)]);
$model->updateOrderStatus($orderStatus, ['comment' => request()->input('status_comment')]);

if (request()->input('processed', false))
$model->markAsPaymentProcessed();
}
}

0 comments on commit 75ac21b

Please sign in to comment.