pub async fn get_ticket_by_id(
__arg0: Path<i32>,
__arg1: State<Arc<AppState>>,
) -> Result<impl IntoResponse, (StatusCode, Json<Value>)>Expand description
Retrieves a specific ticket by ID.
Includes full ticket details and denormalized user information (creator name).
Returns a TicketResponse with all metadata by joining with User table.
§Arguments
Path(id): Ticket ID to retrieve, extracted from URL pathState(data): Application state containingAppStatefor database access
§Returns
200 OKwithTicketResponseobject404 Not Foundif ticket doesn’t exist500 Internal Server Errorif database error occurs
§Example Response
{
"id": 1,
"category": "maintenance",
"betreff": "Broken light in room 101",
"description": "The ceiling light is not working",
"room": 101,
"status": "open",
"date": "2024-01-15T10:30:00Z",
"user_id": 5,
"user_first_name": "John",
"user_last_name": "Doe"
}