mirror of
https://github.com/hanzoai/captable.git
synced 2026-10-16 14:21:29 +00:00
refactor: remove type casting
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { ErrorResponses } from "@/server/api/error";
|
||||
import type { PublicAPI } from "@/server/api/hono";
|
||||
import { createRoute, z } from "@hono/zod-openapi";
|
||||
import type { Context } from "hono";
|
||||
|
||||
export const RequestSchema = z.object({
|
||||
id: z
|
||||
@@ -45,7 +44,7 @@ const route = createRoute({
|
||||
},
|
||||
});
|
||||
const getOne = (app: PublicAPI) => {
|
||||
app.openapi(route, (c: Context) => {
|
||||
app.openapi(route, (c) => {
|
||||
const params = c.req.param();
|
||||
|
||||
return c.json(
|
||||
|
||||
@@ -2,10 +2,8 @@ import { withMemberAuth } from "@/server/api/auth";
|
||||
import { ErrorResponses } from "@/server/api/error";
|
||||
import type { PublicAPI } from "@/server/api/hono";
|
||||
import { ApiCompanySchema } from "@/server/api/schema/company";
|
||||
import { db } from "@/server/db";
|
||||
import { createRoute, z } from "@hono/zod-openapi";
|
||||
import type { Company } from "@prisma/client";
|
||||
import type { Context } from "hono";
|
||||
|
||||
const route = createRoute({
|
||||
method: "get",
|
||||
@@ -26,7 +24,8 @@ const route = createRoute({
|
||||
},
|
||||
});
|
||||
const getMany = (app: PublicAPI) => {
|
||||
app.openapi(route, async (c: Context) => {
|
||||
app.openapi(route, async (c) => {
|
||||
const db = c.get("db");
|
||||
const { membership } = await withMemberAuth(c);
|
||||
const companyIds = membership.map((m) => m.companyId);
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ import { ApiError, ErrorResponses } from "@/server/api/error";
|
||||
import type { PublicAPI } from "@/server/api/hono";
|
||||
import { ApiCompanySchema } from "@/server/api/schema/company";
|
||||
import { createRoute, z } from "@hono/zod-openapi";
|
||||
import type { Context } from "hono";
|
||||
|
||||
export const RequestSchema = z.object({
|
||||
id: z
|
||||
@@ -38,7 +37,7 @@ const route = createRoute({
|
||||
},
|
||||
});
|
||||
const getOne = (app: PublicAPI) => {
|
||||
app.openapi(route, async (c: Context) => {
|
||||
app.openapi(route, async (c) => {
|
||||
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
||||
const { company } = (await withCompanyAuth(c)) as { company: any };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user