2
0

♻️ Add shared eslint config

This commit is contained in:
Baptiste Arnaud
2022-11-21 11:12:43 +01:00
parent e09adf5c64
commit 451ffbcacf
123 changed files with 1151 additions and 1523 deletions

View File

@ -10,6 +10,20 @@ export const answerSchema = z.object({
storageUsed: z.number().nullable(),
})
export const answerInputSchema = answerSchema
.omit({
createdAt: true,
resultId: true,
variableId: true,
storageUsed: true,
})
.and(
z.object({
variableId: z.string().nullish(),
storageUsed: z.number().nullish(),
})
)
export type Stats = {
totalViews: number
totalStarts: number
@ -17,3 +31,5 @@ export type Stats = {
}
export type Answer = z.infer<typeof answerSchema>
export type AnswerInput = z.infer<typeof answerInputSchema>