-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 [open-formulieren/open-forms#3362] Handle server side redirects
- Loading branch information
Showing
3 changed files
with
170 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
* Get the correct redirect path for an action. | ||
* @param {string} action The action to be performed. | ||
* @param {URLSearchParams} actionParams The params linked to the action. | ||
* @returns {{path: string, query?: URLSearchParams}} An object containing the pathname to be used, | ||
* alongside with optional query parameters. | ||
*/ | ||
export const getRedirectParams = (action, actionParams) => { | ||
switch (action) { | ||
case 'cosign': | ||
return { | ||
path: 'cosign', | ||
query: new URLSearchParams({submission_uuid: actionParams.get('submission_uuid')}), | ||
}; | ||
case 'afspraak-annuleren': | ||
return {path: 'afspraak-annuleren'}; | ||
case 'afspraak-maken': | ||
return {path: 'afspraak-maken'}; | ||
case 'resume': | ||
return {path: `stap/${actionParams.get('next_step')}`}; | ||
default: | ||
return {}; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters