@@ -77,7 +77,11 @@ const getEndpointLayoutContext = (
7777) : EndpointLayoutContext => {
7878 const prefix = pascalCase ( [ route . path . split ( '/' ) , endpoint . name ] . join ( '_' ) )
7979
80- const methodParamName = getMethodParamName ( endpoint . name , route . name )
80+ const methodParamName = [ 'GET' , 'DELETE' ] . includes (
81+ endpoint . request . semanticMethod ,
82+ )
83+ ? 'params'
84+ : 'body'
8185
8286 const requestFormat = [ 'GET' , 'DELETE' ] . includes (
8387 endpoint . request . preferredMethod ,
@@ -127,27 +131,3 @@ const getResponseContext = (
127131
128132const getClassName = ( name : string | null ) : string =>
129133 `SeamHttp${ pascalCase ( name ?? '' ) } `
130-
131- const getMethodParamName = (
132- endpointName : string ,
133- routeName : string ,
134- ) : 'params' | 'body' => {
135- // UPSTREAM: This function implements a workaround, as the request format should always follow the semantic method.
136- // Blocked on https://github.com/seamapi/nextlove/issues/117
137- // and https://github.com/seamapi/javascript-http/issues/43
138- //
139- // The desired implementation:
140- //
141- // return ['GET', 'DELETE'].includes(endpoint.request.semanticMethod)
142- // ? 'params'
143- // : 'body'
144-
145- if ( routeName . includes ( 'simulate' ) ) return 'body'
146- if ( [ 'get' , 'list' , 'view' ] . includes ( endpointName ) ) return 'params'
147- if ( [ 'delete' ] . includes ( endpointName ) ) return 'params'
148- if ( endpointName . includes ( 'revoke' ) ) return 'params'
149- if ( endpointName . includes ( 'remove' ) ) return 'params'
150- if ( endpointName . includes ( 'deactivate' ) ) return 'params'
151- if ( endpointName . startsWith ( 'list' ) ) return 'params'
152- return 'body'
153- }
0 commit comments