refactor: migrate devices to store
This commit is contained in:
parent
b1fa048081
commit
6bb3e8a27f
4 changed files with 25 additions and 10 deletions
|
|
@ -6,7 +6,7 @@ use axum::{
|
|||
};
|
||||
|
||||
use crate::{
|
||||
gpodder::{self, DeviceRepository},
|
||||
gpodder,
|
||||
server::{
|
||||
error::{AppError, AppResult},
|
||||
gpodder::{
|
||||
|
|
@ -38,7 +38,7 @@ async fn get_devices(
|
|||
}
|
||||
|
||||
Ok(
|
||||
tokio::task::spawn_blocking(move || ctx.repo.devices_for_user(&user))
|
||||
tokio::task::spawn_blocking(move || ctx.store.devices_for_user(&user))
|
||||
.await
|
||||
.unwrap()
|
||||
.map(Json)?,
|
||||
|
|
@ -55,7 +55,7 @@ async fn post_device(
|
|||
return Err(AppError::NotFound);
|
||||
}
|
||||
|
||||
tokio::task::spawn_blocking(move || ctx.repo.update_device_info(&user, &id, patch))
|
||||
tokio::task::spawn_blocking(move || ctx.store.update_device_info(&user, &id, patch))
|
||||
.await
|
||||
.unwrap()?;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue