* feat: generate transcription from recording * fix: api * chore: undo * tests: add unit tests * chore: refactor move zod type * fix: add more security check * chore: update test * chore: type err * chore: test * chore: fix tyoe * fix: build err * chore: add try .. catch * chore: update desc --------- Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
21 lines
569 B
TypeScript
21 lines
569 B
TypeScript
import { withValidation } from "next-validations";
|
|
import { z } from "zod";
|
|
|
|
import { baseApiParams } from "./baseApiParams";
|
|
|
|
// Extracted out as utility function so can be reused
|
|
// at different endpoints that require this validation.
|
|
export const schemaQueryIdParseInt = baseApiParams.extend({
|
|
id: z.coerce.number(),
|
|
});
|
|
|
|
export const withValidQueryIdTransformParseInt = withValidation({
|
|
schema: schemaQueryIdParseInt,
|
|
type: "Zod",
|
|
mode: "query",
|
|
});
|
|
|
|
export const getTranscriptFromRecordingId = schemaQueryIdParseInt.extend({
|
|
recordingId: z.string(),
|
|
});
|