From d5c77dc13ba43b2ea89973d281ad0a6ef69b92f4 Mon Sep 17 00:00:00 2001 From: Ardeman Date: Thu, 6 Mar 2025 18:46:57 +0800 Subject: [PATCH] feat: enhance news and user schemas with author and subscription details --- app/apis/admin/get-news.ts | 9 +++++---- app/apis/news/get-user.ts | 17 ++++++++++++++--- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/app/apis/admin/get-news.ts b/app/apis/admin/get-news.ts index f0e6cbb..04a0a06 100644 --- a/app/apis/admin/get-news.ts +++ b/app/apis/admin/get-news.ts @@ -13,8 +13,6 @@ const newsSchema = z.object({ id: z.string(), name: z.string(), code: z.string(), - created_at: z.string(), - updated_at: z.string(), }), ), tags: z.array( @@ -22,8 +20,6 @@ const newsSchema = z.object({ id: z.string(), name: z.string(), code: z.string(), - created_at: z.string(), - updated_at: z.string(), }), ), is_premium: z.boolean(), @@ -33,6 +29,11 @@ const newsSchema = z.object({ live_at: z.string(), created_at: z.string(), updated_at: z.string(), + author: z.object({ + id: z.string(), + name: z.string(), + profile_picture: z.string(), + }), }), ), }) diff --git a/app/apis/news/get-user.ts b/app/apis/news/get-user.ts index 060d820..6e53448 100644 --- a/app/apis/news/get-user.ts +++ b/app/apis/news/get-user.ts @@ -6,9 +6,20 @@ const userSchema = z.object({ data: z.object({ id: z.string(), email: z.string(), - subscribe_plan_code: z.string(), - subscribe_plan_name: z.string(), - subscribe_status: z.string(), + phone: z.string(), + subscribe: z.object({ + id: z.string(), + subscribe_plan_id: z.string(), + start_date: z.string(), + end_date: z.string(), + status: z.string(), + auto_renew: z.boolean(), + subscribe_plan: z.object({ + id: z.string(), + name: z.string(), + code: z.string(), + }), + }), }), })