From c6807a554ad3fc7a203dd9d50b2aa3a221a9efe6 Mon Sep 17 00:00:00 2001 From: Hongbo Wu Date: Wed, 15 Nov 2023 12:34:35 +0800 Subject: [PATCH] item_id and saved_at are optional in the post request --- packages/api/src/routers/svc/following.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/api/src/routers/svc/following.ts b/packages/api/src/routers/svc/following.ts index 44a191352..68a016c60 100644 --- a/packages/api/src/routers/svc/following.ts +++ b/packages/api/src/routers/svc/following.ts @@ -9,7 +9,7 @@ export interface SaveFollowingItemRequest { userIds: string[] title: string url: string - itemId: string + itemId?: string addedToFollowingBy: string addedToFollowingFrom: SourceOfFollowing author?: string @@ -18,7 +18,7 @@ export interface SaveFollowingItemRequest { previewContent?: string previewContentType?: string publishedAt?: Date - savedAt: Date + savedAt?: Date } function isSaveFollowingItemRequest( @@ -29,9 +29,7 @@ function isSaveFollowingItemRequest( 'addedToFollowingBy' in body && 'addedToFollowingFrom' in body && 'url' in body && - 'itemId' in body && - 'title' in body && - 'savedAt' in body + 'title' in body ) }