diff --git a/app/utils/api.ts b/app/utils/api.ts index 452c03b..f259774 100644 --- a/app/utils/api.ts +++ b/app/utils/api.ts @@ -1,4 +1,7 @@ import { z } from "zod"; +import type { InternalApi } from "nitropack/types"; + +export type Link = InternalApi["/api/links"]["get"][number]; const apiErrorSchema = z.object({ data: z.object({ diff --git a/server/middleware/redirect.ts b/server/middleware/redirect.ts index 922502c..9f72bcf 100644 --- a/server/middleware/redirect.ts +++ b/server/middleware/redirect.ts @@ -15,7 +15,7 @@ export default defineEventHandler(async (event) => { const path = getRequestURL(event).pathname; - let link = await db.query.links.findFirst({ + const link = await db.query.links.findFirst({ where: eq(tables.links.path, path), }); diff --git a/shared/types/app.ts b/shared/types/app.ts deleted file mode 100644 index b0ab15b..0000000 --- a/shared/types/app.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { InternalApi } from "nitropack/types"; - -export type Link = InternalApi["/api/links"]["get"][number];