Skip to content

Commit

Permalink
Merge pull request #261 from h3poteto/iss-260
Browse files Browse the repository at this point in the history
refs #260 Handle empty response in dismiss notifications
  • Loading branch information
h3poteto authored Nov 18, 2024
2 parents ed2f6f0 + 0af1c19 commit 97e95bb
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/mastodon/mastodon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2719,23 +2719,32 @@ impl megalodon::Megalodon for Mastodon {
let params = HashMap::new();
let res = self
.client
.post::<()>("/api/v1/notifications/clear", &params, None)
.post::<Value>("/api/v1/notifications/clear", &params, None)
.await?;
Ok(res)
Ok(Response::<()>::new(
(),
res.status,
res.status_text,
res.header,
))
}

async fn dismiss_notification(&self, id: String) -> Result<Response<()>, Error> {
let params = HashMap::new();
let res = self
.client
.post::<()>(
.post::<Value>(
format!("/api/v1/notifications/{}/dismiss", id).as_str(),
&params,
None,
)
.await?;

Ok(res)
Ok(Response::<()>::new(
(),
res.status,
res.status_text,
res.header,
))
}

async fn read_notifications(
Expand Down

0 comments on commit 97e95bb

Please sign in to comment.