@@ -45,7 +45,7 @@ export async function renderEndpoint(
4545 ssr : boolean ,
4646 logging : LogOptions
4747) {
48- const { request, params } = context ;
48+ const { request } = context ;
4949
5050 const chosenMethod = request . method ?. toUpperCase ( ) ;
5151 const handler = getHandlerFromModule ( mod , chosenMethod , logging ) ;
@@ -68,35 +68,10 @@ ${chosenMethod} requests are not available when building a static site. Update y
6868 return response ;
6969 }
7070
71- // TODO: Remove support for old API in Astro 3.0
72- if ( handler . length > 1 ) {
73- // eslint-disable-next-line no-console
74- console . warn ( `
75- API routes with 2 arguments have been deprecated. Instead they take a single argument in the form of:
76-
77- export function get({ params, request }) {
78- //...
79- }
80-
81- Update your code to remove this warning.` ) ;
82- }
83-
8471 const proxy = new Proxy ( context , {
8572 get ( target , prop ) {
8673 if ( prop in target ) {
8774 return Reflect . get ( target , prop ) ;
88- } else if ( prop in params ) {
89- // TODO: Remove support for old API in Astro 3.0
90- // eslint-disable-next-line no-console
91- console . warn ( `
92- API routes no longer pass params as the first argument. Instead an object containing a params property is provided in the form of:
93-
94- export function get({ params }) {
95- // ...
96- }
97-
98- Update your code to remove this warning.` ) ;
99- return Reflect . get ( params , prop ) ;
10075 } else {
10176 return undefined ;
10277 }
0 commit comments