fix: handle nullable ads data and ensure safe filtering in advertisements

This commit is contained in:
Ardeman
2025-04-23 13:29:03 +08:00
parent eedb155880
commit 7b4ea17a16
4 changed files with 10 additions and 8 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ const adResponseSchema = z.object({
clicked: z.number(),
})
const adsResponseSchema = z.object({
data: z.array(adResponseSchema),
data: z.array(adResponseSchema).nullable(),
})
export type TAdResponse = z.infer<typeof adResponseSchema>