YESS?
This commit is contained in:
@@ -20,8 +20,13 @@ use common::{CommonAdmin, CommonDriver, CommonTicket};
|
|||||||
async fn api_json_ticket(id: web::Path<i32>) -> impl Responder {
|
async fn api_json_ticket(id: web::Path<i32>) -> impl Responder {
|
||||||
let fetched_ticket_data = get_ticket(&mut establish_connection(), *id);
|
let fetched_ticket_data = get_ticket(&mut establish_connection(), *id);
|
||||||
HttpResponse::Ok()
|
HttpResponse::Ok()
|
||||||
|
.content_type(ContentType::json())
|
||||||
.insert_header(("Access-Control-Allow-Origin", "*"))
|
.insert_header(("Access-Control-Allow-Origin", "*"))
|
||||||
.insert_header(("content_type", "application/json"))
|
.insert_header(("Access-Control-Allow-Methods", "GET"))
|
||||||
|
.insert_header((
|
||||||
|
"Access-Control-Allow-Headers",
|
||||||
|
"Content-Type, Content-Length, User-Agent, X-Requested-With, Range, DNT ",
|
||||||
|
))
|
||||||
.json(fetched_ticket_data)
|
.json(fetched_ticket_data)
|
||||||
}
|
}
|
||||||
#[post("api/json/ticket/new")]
|
#[post("api/json/ticket/new")]
|
||||||
|
|||||||
Reference in New Issue
Block a user