File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ ' astro ' : patch
3+ ---
4+
5+ Fix for APIRoute type
Original file line number Diff line number Diff line change @@ -883,18 +883,10 @@ export interface EndpointOutput<Output extends Body = Body> {
883883 body : Output ;
884884}
885885
886- interface APIRoute {
887- ( context : APIContext ) : EndpointOutput | Response ;
888-
889- /**
890- * @deprecated
891- * Use { context: APIRouteContext } object instead.
892- */
893- ( params : Params , request : Request ) : EndpointOutput | Response ;
894- }
886+ export type APIRoute = ( context : APIContext ) => EndpointOutput | Response ;
895887
896888export interface EndpointHandler {
897- [ method : string ] : APIRoute ;
889+ [ method : string ] : APIRoute | ( ( params : Params , request : Request ) => EndpointOutput | Response ) ;
898890}
899891
900892export interface AstroRenderer {
Original file line number Diff line number Diff line change @@ -517,7 +517,7 @@ Update your code to remove this warning.`);
517517 } ,
518518 } ) as APIContext & Params ;
519519
520- return await handler . call ( mod , proxy , request ) ;
520+ return handler . call ( mod , proxy , request ) ;
521521}
522522
523523async function replaceHeadInjection ( result : SSRResult , html : string ) : Promise < string > {
You can’t perform that action at this time.
0 commit comments