This commit is contained in:
LinlyBoi
2022-12-26 23:05:40 +02:00
parent 1e195f12e2
commit dd4685d8ae

View File

@@ -22,7 +22,7 @@ async fn api_json_ticket(id: web::Path<i32>) -> impl Responder {
HttpResponse::Ok()
.content_type(ContentType::json())
.insert_header(("Access-Control-Allow-Origin", "*"))
.insert_header(("Access-Control-Allow-Methods", "GET"))
.insert_header(("content-encoded", "gzip"))
.insert_header((
"Access-Control-Allow-Headers",
"Content-Type, Content-Length, User-Agent, X-Requested-With, Range, DNT ",
@@ -37,7 +37,7 @@ async fn api_json_ticket_new(ticket: web::Json<CommonTicket>) -> impl Responder
description: &input.description,
category: &input.category,
};
let result = create_ticket(&mut establish_connection(), input_result);
create_ticket(&mut establish_connection(), input_result);
HttpResponse::Ok()
.content_type(ContentType::plaintext())
.insert_header(("Access-Control-Allow-Origin", "*"))