This commit is contained in:
LinlyBoi
2022-12-26 21:42:00 +02:00
parent 8acd2e701d
commit f41ea8e67c

View File

@@ -17,9 +17,11 @@ use common::{CommonAdmin, CommonDriver, CommonTicket};
// Json goodies? NAHH // Json goodies? NAHH
// Ticket Table Services // Ticket Table Services
#[get("api/json/ticket/{id}")] #[get("api/json/ticket/{id}")]
async fn api_json_ticket(id: web::Path<i32>) -> Json<CommonTicket> { 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);
Json(fetched_ticket_data) HttpResponse::Ok()
.content_type(ContentType::json())
.json(fetched_ticket_data)
} }
#[post("api/json/ticket/new")] #[post("api/json/ticket/new")]
async fn api_json_ticket_new(ticket: web::Json<CommonTicket>) -> impl Responder { async fn api_json_ticket_new(ticket: web::Json<CommonTicket>) -> impl Responder {