Fix & test GET /videos

This commit is contained in:
Zoe Roux
2025-05-03 14:37:05 +02:00
parent 45e769828b
commit e26bc931f5
8 changed files with 232 additions and 30 deletions
+1
View File
@@ -13,6 +13,7 @@ export const Resource = () =>
id: t.String({ format: "uuid" }),
slug: t.String({ format: "slug" }),
});
export type Resource = ReturnType<typeof Resource>["static"];
const checker = TypeCompiler.Compile(t.String({ format: "uuid" }));
export const isUuid = (id: string) => checker.Check(id);
+2 -5
View File
@@ -167,10 +167,7 @@ export const Guesses = t.Object({
paths: t.Array(t.String()),
guesses: t.Record(
t.String(),
t.Record(
t.Union([t.Literal("unknown"), t.String({ pattern: "[1-9][0-9]*" })]),
Resource(),
),
t.Record(t.String({ pattern: "^([1-9][0-9]{3})|unknown$" }), Resource()),
),
unmatched: t.Array(t.String()),
});
@@ -188,7 +185,7 @@ registerExamples(Guesses, {
id: "43b742f5-9ce6-467d-ad29-74460624020a",
slug: "evangelion",
},
1995: {
"1995": {
id: "43b742f5-9ce6-467d-ad29-74460624020a",
slug: "evangelion",
},