Add REST endpoint for slot

This commit is contained in:
Simon Goller 2024-05-02 23:25:04 +02:00
parent 82e89baeeb
commit 8f378472ea
28 changed files with 1925 additions and 28 deletions

View file

@ -4,10 +4,12 @@ use async_trait::async_trait;
use dao::DaoError;
use sqlx::{query, query_as, SqlitePool};
pub mod slot;
pub trait ResultDbErrorExt<T, E> {
fn map_db_error(self) -> Result<T, DaoError>;
}
impl<T, E: std::error::Error + 'static> ResultDbErrorExt<T, E> for Result<T, E> {
impl<T, E: std::error::Error + Send + Sync + 'static> ResultDbErrorExt<T, E> for Result<T, E> {
fn map_db_error(self) -> Result<T, DaoError> {
self.map_err(|err| DaoError::DatabaseQueryError(Box::new(err)))
}