From 745912e55a207b511de40325b809bd451fa73564 Mon Sep 17 00:00:00 2001 From: Landon Gavin Date: Fri, 19 Apr 2024 12:15:51 -0400 Subject: [PATCH] fix: fix formatted code generated prettier was replacing the quotes with double quotes causing th checks to break. --- src/cli.mts | 2 +- src/createExports.mts | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) 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));