tweak endpoints

This commit is contained in:
Joe Ardent 2023-06-08 09:17:11 -07:00
parent 9505266ef9
commit 1e9d97bd19
2 changed files with 39 additions and 9 deletions

View file

@ -1,3 +1,36 @@
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() {}
@ -5,10 +38,8 @@ pub async fn post_add_watch() {}
pub async fn get_watch() {}
/// everything the user has saved
pub async fn get_my_watches() {}
/// Add a Watch to user's to-watch list
pub async fn post_add_to_mine() {}
/// list of all watches?
pub async fn get_watches() {}
pub async fn get_search_watch() {}
pub async fn post_search_watch() {}

View file

@ -1,9 +1,8 @@
use serde::{Deserialize, Serialize};
use uuid::Uuid;
mod handlers;
pub use handlers::*;
pub mod handlers;
pub mod templates;
#[derive(
Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize, sqlx::Type,