-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show off simple schema parsing of query params
- Loading branch information
1 parent
9177e6e
commit 2dd60c3
Showing
2 changed files
with
12 additions
and
2 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 |
---|---|---|
@@ -1,6 +1,14 @@ | ||
import { Context } from 'hono'; | ||
import { zfd } from 'zod-form-data'; | ||
|
||
import { regOptionsInputSchema } from '../schemas'; | ||
|
||
|
||
/** | ||
* Generate registration options | ||
*/ | ||
export async function handleCreateRegOptions(context: Context): Promise<Response> { | ||
return context.text('handleCreateRegOptions'); | ||
const parsedInput = zfd.formData(regOptionsInputSchema).parse(context.req.query()); | ||
console.log(parsedInput); | ||
return context.text(`handleCreateRegOptions ${JSON.stringify(parsedInput)}`); | ||
} |
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