Something changed idk
This commit is contained in:
@@ -8,7 +8,7 @@ import { authMiddleware } from "../middleware/authorization";
|
|||||||
/* /v1/company/[id] */
|
/* /v1/company/[id] */
|
||||||
export default createRoute(
|
export default createRoute(
|
||||||
"get",
|
"get",
|
||||||
["/:identifier"],
|
["/company/:identifier"],
|
||||||
async (c) => {
|
async (c) => {
|
||||||
const company = await companies.fetch(c.req.param("identifier"));
|
const company = await companies.fetch(c.req.param("identifier"));
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,4 @@
|
|||||||
export { default as fetchAll } from "./fetchAll";
|
import { default as fetchAll } from "./fetchAll";
|
||||||
//export { default as fetch } from "./fetch";
|
import { default as fetch } from "./fetch";
|
||||||
|
|
||||||
|
export { fetch, fetchAll };
|
||||||
|
|||||||
+1
-1
@@ -49,7 +49,7 @@ app.notFound((c) => {
|
|||||||
v1.route("/teapot", teapot);
|
v1.route("/teapot", teapot);
|
||||||
v1.route("/auth", require("./routers/authRouter").default);
|
v1.route("/auth", require("./routers/authRouter").default);
|
||||||
v1.route("/user", require("./routers/user").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);
|
app.route("/v1", v1);
|
||||||
|
|
||||||
export default app;
|
export default app;
|
||||||
|
|||||||
@@ -5,11 +5,7 @@ export const companies = {
|
|||||||
async fetch(identifier: string | number): Promise<CompanyController> {
|
async fetch(identifier: string | number): Promise<CompanyController> {
|
||||||
const search = await prisma.company.findFirst({
|
const search = await prisma.company.findFirst({
|
||||||
where: {
|
where: {
|
||||||
OR: [
|
OR: [{ id: identifier as string }],
|
||||||
{ id: identifier as string },
|
|
||||||
{ cw_CompanyId: identifier as number },
|
|
||||||
{ cw_Identifier: identifier as string },
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user