diff --git a/frontend/src/lib/repo-summaries.ts b/frontend/src/lib/repo-summaries.ts index e0ba4aa..e07df9f 100644 --- a/frontend/src/lib/repo-summaries.ts +++ b/frontend/src/lib/repo-summaries.ts @@ -1,15 +1,16 @@ -import { Temporal, toTemporalInstant } from '@js-temporal/polyfill'; +import { Temporal } from '@js-temporal/polyfill'; import { z } from 'zod'; export const SloType = z.enum(["triage", "urgent", "important", "none"]); export type SloType = z.infer; const duration = z.string().transform(val => Temporal.Duration.from(val)); +const instant = z.string().transform(val => Temporal.Instant.from(val)); export const IssueSummary = z.object({ url: z.string().url(), title: z.string(), - createdAt: z.coerce.date().transform(val => toTemporalInstant.call(val)), + createdAt: instant, pull_request: z.object({ draft: z.boolean().default(false) }).optional(), labels: z.array(z.string()), sloTimeUsed: duration, @@ -23,7 +24,7 @@ export const IssueSummary = z.object({ export type IssueSummary = z.infer; export const RepoSummary = z.object({ - cachedAt: z.string().transform(val => Temporal.Instant.from(val)), + cachedAt: instant, org: z.string(), repo: z.string(), issues: IssueSummary.array(),