fix: Return available actions from getAvailableActions() method
The match statement wasn't returning the actions array, causing no actions to display on inspection orders. Changed to directly return the match result.
This commit is contained in:
@@ -182,23 +182,19 @@ class OpsController extends Controller
|
||||
*/
|
||||
private function getAvailableActions(Order $order): array
|
||||
{
|
||||
$actions = [];
|
||||
|
||||
match ($order->status) {
|
||||
return match ($order->status) {
|
||||
'inspection' => [
|
||||
$actions['markInspectionPassed'] = true,
|
||||
$actions['flagInspectionIssue'] = true,
|
||||
'markInspectionPassed' => true,
|
||||
'flagInspectionIssue' => true,
|
||||
],
|
||||
'packing' => [
|
||||
$actions['confirmPacking'] = true,
|
||||
'confirmPacking' => true,
|
||||
],
|
||||
'ready_to_ship', 'awaiting_collection', 'in_transit' => [
|
||||
$actions['readOnly'] = true,
|
||||
'readOnly' => true,
|
||||
],
|
||||
default => []
|
||||
};
|
||||
|
||||
return $actions;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user