Fix form submission staying in draft status
All checks were successful
linter / quality (pull_request) Successful in 1m34s
security / Dependency Audit (pull_request) Successful in 1m30s
security / Static Analysis (pull_request) Successful in 1m32s
tests / ci (8.4) (pull_request) Successful in 1m25s
tests / ci (8.5) (pull_request) Successful in 1m58s

When no active approval workflow exists, ApprovalService::submit() was
silently returning, leaving the request in Draft while showing a false
success message. Now throws a RuntimeException as a safety net, and the
Livewire component guards before creating any records and shows a clear
error to the user.
This commit is contained in:
2026-03-06 04:23:55 +00:00
parent de6e7e6632
commit e01caf678b
3 changed files with 137 additions and 2 deletions

View File

@@ -17,7 +17,7 @@ class ApprovalService
$workflow = $travelRequest->workflow;
if (! $workflow) {
return;
throw new \RuntimeException('No active approval workflow is configured.');
}
$steps = $workflow->steps()->orderBy('order')->get();