delete_ticket

Function delete_ticket 

Source
pub async fn delete_ticket(
    __arg0: Path<i32>,
    __arg1: State<Arc<AppState>>,
) -> Result<impl IntoResponse, (StatusCode, Json<Value>)>
Expand description

Deletes a ticket by ID.

Only admins can delete tickets (enforced by middleware). Removes the TicketResponse and associated data from the database.

§Arguments

  • Path(id): Ticket ID to delete, extracted from URL path
  • State(data): Application state containing AppState for database access

§Returns

  • 204 No Content on successful deletion
  • 404 Not Found if ticket doesn’t exist
  • 500 Internal Server Error if database error occurs