Skip to content

Commit

Permalink
Merge pull request #53 from systopia/redirect-to-funding-case
Browse files Browse the repository at this point in the history
Redirect to funding case after adding an application
  • Loading branch information
dontub authored May 24, 2024
2 parents 0b71b8e + ebf54d8 commit e17347a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Controller/FundingCaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use Drupal\civiremote_funding\Form\FundingCaseForm;
use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\Url;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;

/**
Expand All @@ -43,7 +44,7 @@ public function __construct(FundingApi $fundingApi) {
/**
* @return array<int|string, mixed>
*/
public function content(int $fundingCaseId): array {
public function content(Request $request, int $fundingCaseId): array {
$fundingCase = $this->fundingApi->getFundingCase($fundingCaseId);
if (NULL === $fundingCase) {
throw new NotFoundHttpException();
Expand Down Expand Up @@ -74,7 +75,11 @@ public function content(int $fundingCaseId): array {
['@type' => $fundingCaseType->getApplicationProcessLabel()]
),
],
'#url' => Url::fromRoute('civiremote_funding.case_application_add', ['fundingCaseId' => $fundingCaseId]),
'#url' => Url::fromRoute(
'civiremote_funding.case_application_add',
['fundingCaseId' => $fundingCaseId],
['query' => ['destination' => $request->getRequestUri()]]
),
];
}

Expand Down

0 comments on commit e17347a

Please sign in to comment.