pub async fn delete_ticket_message(
__arg0: Path<(i64, i64, i64, i64)>,
__arg1: State<AppState>,
__arg2: Extension<AuthUser>,
) -> impl IntoResponse
Expand description
DELETE /api/modules/{module_id}/assignments/{assignment_id}/tickets/{ticket_id}/messages/{message_id}
Delete a ticket message. Only the author of the message may delete it.
§Path Parameters
module_id
(i64): Module ID (present in the route for authorization scope)assignment_id
(i64): Assignment ID (present in the route for authorization scope)ticket_id
(i64): Ticket ID (present in the route for authorization scope)message_id
(i64): The ID of the message to delete
§Authorization
- Requires a valid bearer token
- Caller must be the author of the message; otherwise
403 Forbidden
is returned
§WebSocket Broadcast
- On success, broadcasts:
{ "event": "message_deleted", "payload": { "id": <message_id> } }
to topic:
ws/tickets/{ticket_id}
§Responses
200 OK
— Message deleted
{
"success": true,
"message": "Message deleted successfully",
"data": { "id": 123 }
}
403 Forbidden
— Caller is not the author
{ "success": false, "message": "Forbidden" }
500 Internal Server Error
— Database error while deleting
{ "success": false, "message": "Failed to delete message" }