Function delete_plagiarism_case

Source
pub async fn delete_plagiarism_case(
    __arg0: State<AppState>,
    __arg1: Path<(i64, i64, i64)>,
) -> impl IntoResponse
Expand description

DELETE /api/modules/{module_id}/assignments/{assignment_id}/plagiarism/{case_id}

Permanently deletes a plagiarism case from the system. Accessible only to lecturers and assistant lecturers assigned to the module.

§Path Parameters

  • module_id: The ID of the parent module
  • assignment_id: The ID of the assignment containing the plagiarism case
  • case_id: The ID of the plagiarism case to delete

§Returns

Returns an HTTP response indicating the result:

  • 200 OK with success message when deletion is successful
  • 403 FORBIDDEN if user lacks required permissions
  • 404 NOT FOUND if specified plagiarism case doesn’t exist
  • 500 INTERNAL SERVER ERROR for database errors or deletion failures

The response body follows a standardized JSON format with a success message.

§Example Response (200 OK)

{
  "success": true,
  "message": "Plagiarism case deleted successfully"
}

§Example Responses

  • 404 Not Found
{
  "success": false,
  "message": "Plagiarism case not found"
}
  • 500 Internal Server Error
{
  "success": false,
  "message": "Failed to delete plagiarism case: [error details]"
}

§Notes

This operation is irreversible and permanently removes the plagiarism case record. Only users with lecturer or assistant lecturer roles assigned to the module can perform this action.