fix params

This commit is contained in:
Rizky 2024-04-18 12:12:42 +07:00
parent 8374511aef
commit 08bc51b752
1 changed files with 6 additions and 0 deletions

View File

@ -18,6 +18,12 @@ const parseQueryParams = (ctx: any) => {
};
export const apiContext = (ctx: any) => {
ctx.req.params = ctx.params;
if (ctx.params["_0"]) {
ctx.params["_"] = ctx.params["_0"];
delete ctx.params["_0"];
}
ctx.req.query_parameters = parseQueryParams(ctx);
return {
req: ctx.req as Request & { params: any; query_parameters: any },