item_id and saved_at are optional in the post request

This commit is contained in:
Hongbo Wu 2023-11-15 12:34:35 +08:00
parent c59b4ca97e
commit c6807a554a

View file

@ -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
)
}