Add tags for schedules
This commit is contained in:
parent
f3f3d36eed
commit
75f8afd624
10 changed files with 375 additions and 184 deletions
src/db
|
@ -3,12 +3,13 @@ use actix_web::http::StatusCode;
|
|||
use serde::ser::SerializeStruct;
|
||||
use serde::{Serialize, Serializer};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum DatabaseError {
|
||||
DeleteError,
|
||||
InsertError,
|
||||
InsertError(diesel::result::Error),
|
||||
InsertGetError,
|
||||
NotFound,
|
||||
Protected
|
||||
Protected,
|
||||
}
|
||||
|
||||
impl DatabaseError {
|
||||
|
@ -37,7 +38,7 @@ impl Serialize for DatabaseError {
|
|||
impl From<&DatabaseError> for String {
|
||||
fn from(err: &DatabaseError) -> Self {
|
||||
match err {
|
||||
DatabaseError::InsertError => String::from("error on inserting into database"),
|
||||
DatabaseError::InsertError(_) => String::from("error on inserting into database"),
|
||||
DatabaseError::InsertGetError => {
|
||||
String::from("error on retrieving new entry from database (your entry was saved)")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue