Skip to content

Commit fdd57ea

Browse files
committed
Fix format issues
1 parent 5eac29c commit fdd57ea

3 files changed

Lines changed: 9 additions & 8 deletions

File tree

codegen/layouts/partials/route-class-endpoint.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{{methodName}}(
22
{{requestFormat}}{{#if isOptionalParamsOk}}?{{/if}}: {{requestTypeName}},
3-
{{#if hasOptions}}options: {{optionsTypeName}},{{/if}}
3+
{{#if hasOptions}}options: {{optionsTypeName}} = {},{{/if}}
44
): SeamHttpRequest<{{#if returnsVoid}}void, undefined{{else}}{{responseTypeName}}, '{{responseKey}}'{{/if}}>
55
{
66
return new SeamHttpRequest(this, {
77
pathname: '{{path}}',
8-
method: {{method}},
8+
method: '{{method}}',
99
{{requestFormat}},
1010
responseKey: {{#if returnsVoid}}undefined{{else}}'{{responseKey}}'{{/if}},
1111
{{#if hasOptions}}options,{{/if}}

codegen/layouts/partials/route-imports.hbs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ import {
3838
import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
3939
import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js'
4040

41-
{{#unless isClientSessionRoute}}
42-
import { SeamHttpClientSessions } from './client-sessions.js'
43-
{{/unless}}
41+
{{#if skipClientSessionImport}}
42+
import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js'
43+
{{/if}}
4444

4545
{{#each subroutes}}
4646
import { {{className}} } from './{{fileName}}'

codegen/lib/connect.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ interface RouteLayoutContext {
8484
className: string
8585
endpoints: EndpointLayoutContext[]
8686
subroutes: SubrouteLayoutContext[]
87-
isClientSessionRoute: boolean
87+
skipClientSessionImport: boolean
8888
}
8989

9090
interface EndpointLayoutContext {
@@ -118,7 +118,8 @@ const setRouteLayoutContext = (
118118
blueprint: Blueprint,
119119
): void => {
120120
file.className = getClassName(node?.path ?? null)
121-
file.isClientSessionRoute = node?.name === '/client_sessions'
121+
file.skipClientSessionImport =
122+
node?.path === '/client_sessions' || node?.path === '/'
122123

123124
file.endpoints = []
124125
if (node != null && 'endpoints' in node) {
@@ -140,7 +141,7 @@ const getSubrouteLayoutContext = (
140141
route: Pick<Route, 'path' | 'name'>,
141142
): SubrouteLayoutContext => {
142143
return {
143-
fileName: `${kebabCase(route.name)}.js`,
144+
fileName: `${kebabCase(route.name)}/index.js`,
144145
methodName: camelCase(route.name),
145146
className: getClassName(route.path),
146147
}

0 commit comments

Comments
 (0)