This commit is contained in:
LinlyBoi
2022-12-26 09:32:46 +02:00
parent 6002cfb866
commit 8acd2e701d
2 changed files with 2 additions and 0 deletions

View File

@@ -44,6 +44,7 @@ pub struct Ticket {
#[derive(Insertable)] #[derive(Insertable)]
#[diesel(table_name = tickets)] #[diesel(table_name = tickets)]
pub struct NewTicket<'a> { pub struct NewTicket<'a> {
pub id: i32,
pub category: &'a str, pub category: &'a str,
pub description: &'a str, pub description: &'a str,
} }

View File

@@ -25,6 +25,7 @@ async fn api_json_ticket(id: web::Path<i32>) -> Json<CommonTicket> {
async fn api_json_ticket_new(ticket: web::Json<CommonTicket>) -> impl Responder { async fn api_json_ticket_new(ticket: web::Json<CommonTicket>) -> impl Responder {
let input = ticket.into_inner(); let input = ticket.into_inner();
let input_result = NewTicket { let input_result = NewTicket {
id: input.id,
description: &input.description, description: &input.description,
category: &input.category, category: &input.category,
}; };