refactor: moved knowledge of subscription change time to store
This commit is contained in:
parent
8a9744c4a9
commit
330877c8c5
6 changed files with 72 additions and 25 deletions
|
|
@ -85,8 +85,8 @@ pub async fn get_subscription_changes(
|
|||
.unwrap()
|
||||
.map(|(next_time_changed, add, remove)| {
|
||||
Json(SubscriptionDeltaResponse {
|
||||
add,
|
||||
remove,
|
||||
add: add.into_iter().map(|s| s.url).collect(),
|
||||
remove: remove.into_iter().map(|s| s.url).collect(),
|
||||
timestamp: next_time_changed.timestamp(),
|
||||
})
|
||||
})?)
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ pub async fn get_device_subscriptions(
|
|||
tokio::task::spawn_blocking(move || ctx.store.subscriptions_for_device(&user, &id))
|
||||
.await
|
||||
.unwrap()
|
||||
.map(Json)?,
|
||||
.map(|subs| Json(subs.into_iter().map(|s| s.url).collect()))?,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -54,7 +54,7 @@ pub async fn get_user_subscriptions(
|
|||
tokio::task::spawn_blocking(move || ctx.store.subscriptions_for_user(&user))
|
||||
.await
|
||||
.unwrap()
|
||||
.map(Json)?,
|
||||
.map(|subs| Json(subs.into_iter().map(|s| s.url).collect()))?,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue