diff --git a/src/cli.mts b/src/cli.mts index cb93fc4..a12d568 100644 --- a/src/cli.mts +++ b/src/cli.mts @@ -54,7 +54,7 @@ async function setupProgram() { const options = program.opts(); - generate(options, version); + await generate(options, version); } setupProgram(); diff --git a/src/createExports.mts b/src/createExports.mts index f94e231..d769875 100644 --- a/src/createExports.mts +++ b/src/createExports.mts @@ -6,20 +6,20 @@ export const createExports = (service: Service) => { const { klasses } = service; const methods = klasses.map((k) => k.methods).flat(); - const allGet = methods.filter( - (m) => m.httpMethodName.toUpperCase() === "'GET'" + const allGet = methods.filter((m) => + m.httpMethodName.toUpperCase().includes("GET") ); - const allPost = methods.filter( - (m) => m.httpMethodName.toUpperCase() === "'POST'" + const allPost = methods.filter((m) => + m.httpMethodName.toUpperCase().includes("POST") ); - const allPut = methods.filter( - (m) => m.httpMethodName.toUpperCase() === "'PUT'" + const allPut = methods.filter((m) => + m.httpMethodName.toUpperCase().includes("PUT") ); - const allPatch = methods.filter( - (m) => m.httpMethodName.toUpperCase() === "'PATCH'" + const allPatch = methods.filter((m) => + m.httpMethodName.toUpperCase().includes("PATCH") ); - const allDelete = methods.filter( - (m) => m.httpMethodName.toUpperCase() === "'DELETE'" + const allDelete = methods.filter((m) => + m.httpMethodName.toUpperCase().includes("DELETE") ); const allGetQueries = allGet.map((m) => createUseQuery(m));