Skip to content

Commit 10d79dd

Browse files
committed
Fix prefix
1 parent 86b9adc commit 10d79dd

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

codegen/lib/connect.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,9 @@ const getSubrouteLayoutContext = (
149149

150150
const getEndpointLayoutContext = (
151151
endpoint: Endpoint,
152-
route: Pick<Route, 'name'>,
152+
route: Pick<Route, 'path'>,
153153
): EndpointLayoutContext => {
154-
const prefix = `${pascalCase(route.name)}${pascalCase(endpoint.name)}`
154+
const prefix = pascalCase([route.path.split('/'), endpoint.name].join('_'))
155155

156156
const requestFormat = ['GET', 'DELETE'].includes(
157157
endpoint.request.semanticMethod,
@@ -185,10 +185,7 @@ const getEndpointLayoutContext = (
185185

186186
const getResponseContext = (
187187
endpoint: Endpoint,
188-
): Pick<
189-
EndpointLayoutContext,
190-
'returnsVoid' | 'responseKey' | 'resourceType'
191-
> => {
188+
): Pick<EndpointLayoutContext, 'returnsVoid' | 'responseKey'> => {
192189
if (endpoint.response.responseType === 'void')
193190
return {
194191
returnsVoid: true,

0 commit comments

Comments
 (0)