diff --git a/src/api/companies/fetch.ts b/src/api/companies/fetch.ts index d7345b3..aed035a 100644 --- a/src/api/companies/fetch.ts +++ b/src/api/companies/fetch.ts @@ -8,7 +8,7 @@ import { authMiddleware } from "../middleware/authorization"; /* /v1/company/[id] */ export default createRoute( "get", - ["/:identifier"], + ["/company/:identifier"], async (c) => { const company = await companies.fetch(c.req.param("identifier")); diff --git a/src/api/companies/index.ts b/src/api/companies/index.ts index 2e25161..011fed2 100644 --- a/src/api/companies/index.ts +++ b/src/api/companies/index.ts @@ -1,2 +1,4 @@ -export { default as fetchAll } from "./fetchAll"; -//export { default as fetch } from "./fetch"; +import { default as fetchAll } from "./fetchAll"; +import { default as fetch } from "./fetch"; + +export { fetch, fetchAll }; diff --git a/src/api/server.ts b/src/api/server.ts index c236d34..99a36f0 100644 --- a/src/api/server.ts +++ b/src/api/server.ts @@ -49,7 +49,7 @@ app.notFound((c) => { v1.route("/teapot", teapot); v1.route("/auth", require("./routers/authRouter").default); v1.route("/user", require("./routers/user").default); -v1.route("/company", require("./routers/companyRouter").default); +v1.route("/", require("./routers/companyRouter").default); app.route("/v1", v1); export default app; diff --git a/src/managers/companies.ts b/src/managers/companies.ts index a6055d7..8892ce9 100644 --- a/src/managers/companies.ts +++ b/src/managers/companies.ts @@ -5,11 +5,7 @@ export const companies = { async fetch(identifier: string | number): Promise { const search = await prisma.company.findFirst({ where: { - OR: [ - { id: identifier as string }, - { cw_CompanyId: identifier as number }, - { cw_Identifier: identifier as string }, - ], + OR: [{ id: identifier as string }], }, });