what2watch/src/watches/handlers.rs

46 lines
1.0 KiB
Rust
Raw Normal View History

2023-06-08 16:17:11 +00:00
use axum::{
extract::{Form, Path, State},
http::StatusCode,
response::{IntoResponse, Response},
};
use sqlx::{query_as, SqlitePool};
use uuid::Uuid;
use crate::{ShowKind, User, Watch};
//-************************************************************************
// Error types for Watch creation
//-************************************************************************
#[Error]
pub struct WatchAddError(#[from] WatchAddErrorKind);
#[Error]
#[non_exhaustive]
pub enum WatchAddErrorKind {
UnknownDBError,
}
impl IntoResponse for WatchAddError {
fn into_response(self) -> Response {
match self.0 {
WatchAddErrorKind::UnknownDBError => {
(StatusCode::INTERNAL_SERVER_ERROR, format!("{self}")).into_response()
}
}
}
}
/// Add a Watch to the whole system
pub async fn post_add_watch() {}
2023-06-05 23:32:42 +00:00
/// A single Watch
pub async fn get_watch() {}
/// everything the user has saved
2023-06-08 16:17:11 +00:00
pub async fn get_watches() {}
2023-06-08 16:17:11 +00:00
pub async fn get_search_watch() {}
2023-06-08 16:17:11 +00:00
pub async fn post_search_watch() {}