using

using
async handle(request: Request, env: any, context: any, data: DataOf<typeof TaskFetch.schema>) {
// Retrieve the validated slug
const { taskSlug } = request.params
async handle(request: Request, env: any, context: any, data: DataOf<typeof TaskFetch.schema>) {
// Retrieve the validated slug
const { taskSlug } = request.params
instead of
async handle(request: Request, env: any, context: any, data: DataOf<typeof TaskFetch.schema>) {
// Retrieve the validated slug
const { taskSlug } = data.params
async handle(request: Request, env: any, context: any, data: DataOf<typeof TaskFetch.schema>) {
// Retrieve the validated slug
const { taskSlug } = data.params
does indeed work, but loses all advantages of the typed system (data: DataOf<typeof TaskFetch.schema>)... which is really undesired
2 Replies
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
Marcel Overdijk
Marcel OverdijkOP8mo ago
thx a lot!
Want results from more Discord servers?
Add your server