Remove Canapi (#540)
* Remove Canapi It added more complexity than it helped. * Fail if there are many blog, but none was specified * cargo fmt
This commit is contained in:
@@ -9,6 +9,8 @@ use serde_json;
|
||||
use plume_common::utils::random_hex;
|
||||
use plume_models::{api_tokens::*, apps::App, users::User, Error, PlumeRocket};
|
||||
|
||||
type Api<T> = Result<Json<T>, ApiError>;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct ApiError(Error);
|
||||
|
||||
@@ -18,6 +20,12 @@ impl From<Error> for ApiError {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<std::option::NoneError> for ApiError {
|
||||
fn from(err: std::option::NoneError) -> ApiError {
|
||||
ApiError(err.into())
|
||||
}
|
||||
}
|
||||
|
||||
impl<'r> Responder<'r> for ApiError {
|
||||
fn respond_to(self, req: &Request) -> response::Result<'r> {
|
||||
match self.0 {
|
||||
|
||||
Reference in New Issue
Block a user