diff --git a/api/src/models/entry/base-entry.ts b/api/src/models/entry/base-entry.ts index cf44680c..451422a1 100644 --- a/api/src/models/entry/base-entry.ts +++ b/api/src/models/entry/base-entry.ts @@ -16,7 +16,8 @@ export const BaseEntry = () => nextRefresh: t.String({ format: "date-time" }), }); -export const EntryTranslation = () => t.Object({ - name: t.Nullable(t.String()), - description: t.Nullable(t.String()), -}); +export const EntryTranslation = () => + t.Object({ + name: t.Nullable(t.String()), + description: t.Nullable(t.String()), + }); diff --git a/api/src/models/entry/episode.ts b/api/src/models/entry/episode.ts index 14baf7c2..2372abe7 100644 --- a/api/src/models/entry/episode.ts +++ b/api/src/models/entry/episode.ts @@ -15,7 +15,11 @@ export const BaseEpisode = t.Intersect([ BaseEntry(), ]); -export const Episode = t.Intersect([Resource(), EntryTranslation(), BaseEpisode]); +export const Episode = t.Intersect([ + Resource(), + EntryTranslation(), + BaseEpisode, +]); export type Episode = Prettify; export const SeedEpisode = t.Intersect([ diff --git a/api/src/models/entry/special.ts b/api/src/models/entry/special.ts index 7806299b..94d91683 100644 --- a/api/src/models/entry/special.ts +++ b/api/src/models/entry/special.ts @@ -25,7 +25,11 @@ export const BaseSpecial = t.Intersect( }, ); -export const Special = t.Intersect([Resource(), EntryTranslation(), BaseSpecial]); +export const Special = t.Intersect([ + Resource(), + EntryTranslation(), + BaseSpecial, +]); export type Special = Prettify; export const SeedSpecial = t.Intersect([ diff --git a/api/src/models/utils/filters/index.ts b/api/src/models/utils/filters/index.ts index 44055814..18fcdd77 100644 --- a/api/src/models/utils/filters/index.ts +++ b/api/src/models/utils/filters/index.ts @@ -1,4 +1,4 @@ -import type { Column, SQL } from "drizzle-orm"; +import type { Column, SQL, SQLWrapper } from "drizzle-orm"; import { t } from "elysia"; import { KErrorT } from "~/models/error"; import { comment } from "~/utils"; @@ -8,7 +8,7 @@ import { toDrizzle } from "./to-sql"; export type FilterDef = { [key: string]: | { - column: Column | SQL; + column: Column | SQLWrapper; type: "int" | "float" | "date" | "string"; isArray?: boolean; } diff --git a/api/src/models/utils/filters/to-sql.ts b/api/src/models/utils/filters/to-sql.ts index b8e57022..dbcb686a 100644 --- a/api/src/models/utils/filters/to-sql.ts +++ b/api/src/models/utils/filters/to-sql.ts @@ -1,4 +1,5 @@ import { + type BinaryOperator, type SQL, and, eq, @@ -16,7 +17,7 @@ import { comment } from "~/utils"; import type { FilterDef } from "./index"; import type { Expression, Operator } from "./parser"; -const opMap: Record = { +const opMap: Record = { eq: eq, ne: ne, gt: gt, diff --git a/api/tests/helpers/series-helper.ts b/api/tests/helpers/series-helper.ts index bbdd6171..5997aeea 100644 --- a/api/tests/helpers/series-helper.ts +++ b/api/tests/helpers/series-helper.ts @@ -101,7 +101,7 @@ export const getUnknowns = async (opts: { query?: string; }) => { const resp = await app.handle( - new Request(buildUrl(`unknowns`, opts), { + new Request(buildUrl("unknowns", opts), { method: "GET", }), );