diff options
| author | Adam Soltys <[email protected]> | 2024-08-21 01:02:06 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-08-21 01:06:14 -0700 |
| commit | 35bfbca2abe1f1d72301e8e63f8b4ae733ba8bf6 (patch) | |
| tree | 5fd804c6dbe45b73208432fa596a862a1d0653e7 /src/lib | |
| parent | dfeb4a844b4bd08c4ddd538887dabdec0b1030b9 (diff) | |
| download | coinos-ui-35bfbca2abe1f1d72301e8e63f8b4ae733ba8bf6.tar.gz coinos-ui-35bfbca2abe1f1d72301e8e63f8b4ae733ba8bf6.zip | |
revamp payment totals
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/handler.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/handler.js b/src/lib/handler.js new file mode 100644 index 00000000..05e484ec --- /dev/null +++ b/src/lib/handler.js @@ -0,0 +1,14 @@ +import { goto } from "$app/navigation"; +import { applyAction } from "$app/forms"; + +export default (submitting) => + ({ formElement, formData, action, cancel }) => { + submitting = true; + return async ({ result }) => { + if (result.type === "redirect") { + goto(result.location); + } else { + await applyAction(result); + } + }; + }; |
