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:
twotalesanimation
2026-01-02 21:17:51 +02:00
parent 66862df44b
commit 341421d2a0
2 changed files with 146 additions and 9 deletions
+5 -9
View File
@@ -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;
}
/**