refactor: migrate devices to store

This commit is contained in:
Jef Roosens 2025-03-15 19:01:38 +01:00
parent b1fa048081
commit 6bb3e8a27f
No known key found for this signature in database
GPG key ID: 21FD3D77D56BAF49
4 changed files with 25 additions and 10 deletions

View file

@ -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()?;