Convert enhanceRouteHandler params into a Promise-based Dynamic API
This commit is contained in:
@@ -72,7 +72,7 @@ export const enhanceRouteHandler = <
|
|||||||
return async function routeHandler(
|
return async function routeHandler(
|
||||||
request: NextRequest,
|
request: NextRequest,
|
||||||
routeParams: {
|
routeParams: {
|
||||||
params: Record<string, string>;
|
params: Promise<Record<string, string>>;
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
type UserParam = Params['auth'] extends false ? undefined : User;
|
type UserParam = Params['auth'] extends false ? undefined : User;
|
||||||
@@ -126,7 +126,7 @@ export const enhanceRouteHandler = <
|
|||||||
request,
|
request,
|
||||||
body,
|
body,
|
||||||
user,
|
user,
|
||||||
params: routeParams.params,
|
params: await routeParams.params,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user