mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-26 11:21:02 +00:00
serde(default)
This commit is contained in:
parent
da7a672208
commit
d56afd3075
2 changed files with 3 additions and 6 deletions
|
@ -11,11 +11,7 @@ pub async fn mark_post_as_read(
|
|||
context: Data<LemmyContext>,
|
||||
local_user_view: LocalUserView,
|
||||
) -> Result<Json<SuccessResponse>, LemmyError> {
|
||||
let mut post_ids = HashSet::new();
|
||||
if let Some(post_ids_) = &data.post_ids {
|
||||
post_ids.extend(post_ids_.iter().cloned());
|
||||
}
|
||||
|
||||
let mut post_ids = data.post_ids.iter().cloned().collect::<HashSet<_>>();
|
||||
if let Some(post_id) = data.post_id {
|
||||
post_ids.insert(post_id);
|
||||
}
|
||||
|
|
|
@ -143,7 +143,8 @@ pub struct RemovePost {
|
|||
pub struct MarkPostAsRead {
|
||||
/// TODO: deprecated, send `post_ids` instead
|
||||
pub post_id: Option<PostId>,
|
||||
pub post_ids: Option<Vec<PostId>>,
|
||||
#[serde(default)]
|
||||
pub post_ids: Vec<PostId>,
|
||||
pub read: bool,
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue