ronan(wighawag)
ronan(wighawag)
Explore posts from servers
HHono
Created by ronan(wighawag) on 10/29/2024 in #help
any option to have $post ignore json when we provide body via init: {body.. ?
const resp = await client.api.scheduling.scheduleExecution.$post(
{json: execution}, // this is not used
{init:{body: jsonAsString}}
);
const resp = await client.api.scheduling.scheduleExecution.$post(
{json: execution}, // this is not used
{init:{body: jsonAsString}}
);
technically {json: execution} is pointless since I provide the body content manually via {init:{body: jsonAsString}} anyway to make hono ignore the json when providing body this way ?
1 replies
HHono
Created by ronan(wighawag) on 10/29/2024 in #help
any way to have different .notFound depending on parent path ?
I have 2 main path: api dashboard I would like anything path under api/.... that do not exit to return a json object but anything under dashboard/... to return a web page for not found is that possible and how ?
2 replies
HHono
Created by ronan(wighawag) on 10/28/2024 in #help
adding generic error output type to App type
Hey all, I am using the typed RPC feature of hono and got it working, except for the errors I have an .onError that consstruct a json from error thrown and I would like that error type to be unioned with each of the output type of all path Is there a way to do this ? Like is there some type generic magic I could add to my exported App type to add an extra type for all outputs Something like export type App = AddErrorType<typeof app, {success: false, errors: {message: string, code: number}[]}> ?
5 replies