feat: move views field into data response schema for news API
This commit is contained in:
parent
65f7bbe0aa
commit
9ab67c615a
@ -23,10 +23,13 @@ export const newsResponseSchema = z.object({
|
|||||||
created_at: z.string(),
|
created_at: z.string(),
|
||||||
updated_at: z.string(),
|
updated_at: z.string(),
|
||||||
author: authorSchema,
|
author: authorSchema,
|
||||||
views: z.number(),
|
|
||||||
})
|
})
|
||||||
const dataResponseSchema = z.object({
|
const dataResponseSchema = z.object({
|
||||||
data: z.array(newsResponseSchema),
|
data: z.array(
|
||||||
|
newsResponseSchema.extend({
|
||||||
|
views: z.number(),
|
||||||
|
}),
|
||||||
|
),
|
||||||
})
|
})
|
||||||
|
|
||||||
export type TNewsResponse = z.infer<typeof newsResponseSchema>
|
export type TNewsResponse = z.infer<typeof newsResponseSchema>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user