-
-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(router): properly parse json response in the FormAction
- Loading branch information
1 parent
16e6ba9
commit 4c703fb
Showing
3 changed files
with
36 additions
and
10 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
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,13 @@ | ||
import { type PageServerAction, json } from '@analogjs/router/server/actions'; | ||
|
||
export type CartSubmitResponse = { | ||
type: 'success'; | ||
message: string; | ||
}; | ||
|
||
export async function action({ event }: PageServerAction) { | ||
return json<CartSubmitResponse>({ | ||
type: 'success', | ||
message: 'Your order has been submitted', | ||
}); | ||
} |
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