support email
This commit is contained in:
+7
-7
@@ -72,16 +72,16 @@ struct JsonResponse {
|
||||
}
|
||||
|
||||
impl JsonResponse {
|
||||
fn success(response: String) -> Self {
|
||||
JsonResponse { response: Some(response), success: true, error_message: None }
|
||||
}
|
||||
fn success(response: String) -> Self {
|
||||
JsonResponse { response: Some(response), success: true, error_message: None }
|
||||
}
|
||||
|
||||
fn error(msg: String) -> Self {
|
||||
JsonResponse { response: None, success: false, error_message: Some(msg) }
|
||||
}
|
||||
fn error(msg: String) -> Self {
|
||||
JsonResponse { response: None, success: false, error_message: Some(msg) }
|
||||
}
|
||||
}
|
||||
|
||||
fn iron_response (status: status::Status, message: String) -> Response {
|
||||
fn iron_response(status: status::Status, message: String) -> Response {
|
||||
let content_type = "application/json".parse::<Mime>().unwrap();
|
||||
let msg = match status {
|
||||
status::Ok => JsonResponse::success(message),
|
||||
|
||||
Reference in New Issue
Block a user