Merge pull request #8 from kingjaypee12/jp/sales-clean-up

feat(SaleResource): redirect to client after sale creation
This commit is contained in:
2026-02-16 02:08:01 +08:00
committed by GitHub

View File

@@ -89,8 +89,12 @@ class CreateSale extends CreateRecord
return $record;
}
protected function afterCreate(): void
protected function getRedirectUrl(): string
{
$branch = Branch::find($this->data['branch_id']);
$client = $this->getClient();
if (! $client) {
return parent::getRedirectUrl();
}
return ClientResource::getUrl('view', ['record' => $client->id]).'?activeRelationManager=3';
}
}