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