Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions codegen/layouts/endpoints.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,6 @@ export class SeamHttpEndpoints {

export type SeamHttpEndpointQueryPaths = {{#each endpointReadPaths}}'{{.}}' {{#unless @last}} | {{/unless}}{{/each}}

export type SeamHttpEndpointPaginatedQueryPaths = {{#each endpointPaginatedPaths}}'{{.}}' {{#unless @last}} | {{/unless}}{{/each}}

export type SeamHttpEndpointMutationPaths = {{#each endpointWritePaths}}'{{.}}' {{#unless @last}} | {{/unless}}{{/each}}
9 changes: 9 additions & 0 deletions codegen/lib/layouts/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export interface EndpointsLayoutContext {
className: string
endpoints: EndpointLayoutContext[]
endpointReadPaths: string[]
endpointPaginatedPaths: string[]
endpointWritePaths: string[]
routeImports: RouteImportLayoutContext[]
skipClientSessionImport: boolean
Expand Down Expand Up @@ -38,6 +39,14 @@ export const setEndpointsLayoutContext = (
.filter(({ request }) => request.semanticMethod === 'GET')
.map(({ path }) => path),
)
file.endpointPaginatedPaths = routes.flatMap((route) =>
route.endpoints
.filter(
({ request, hasPagination }) =>
request.semanticMethod === 'GET' && hasPagination,
)
.map(({ path }) => path),
)
file.endpointWritePaths = routes.flatMap((route) =>
route.endpoints
.filter(({ request }) => request.semanticMethod !== 'GET')
Expand Down
7 changes: 7 additions & 0 deletions src/lib/seam/connect/routes/seam-http-endpoints.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading