Skip to content

Commit

Permalink
refactor: simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien-R44 committed May 4, 2024
1 parent c6bb907 commit 8bfe748
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions packages/core/src/codegen/api_types_generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,13 @@ export class ApiTypesGenerator {
}

currentLevel = currentLevel[segment]
if (i !== segments.length - 1) return

if (i === segments.length - 1) {
currentLevel['$url'] = {}
for (const method of methods) {
currentLevel[method] = {
request: schemaImport ? `MakeTuyauRequest<${schemaImport}>` : 'unknown',
response: `MakeTuyauResponse<import('${relativePath}').default['${routeHandler.method}']>`,
}
currentLevel.$url = {}
for (const method of methods) {
currentLevel[method] = {
request: schemaImport ? `MakeTuyauRequest<${schemaImport}>` : 'unknown',
response: `MakeTuyauResponse<import('${relativePath}').default['${routeHandler.method}']>`,
}
}
})
Expand Down

0 comments on commit 8bfe748

Please sign in to comment.