pub async fn bulk_delete_plagiarism_cases(
__arg0: State<AppState>,
__arg1: Path<(i64, i64)>,
__arg2: Json<BulkDeletePayload>,
) -> impl IntoResponse
Expand description
DELETE /api/modules/{module_id}/assignments/{assignment_id}/plagiarism/bulk
Deletes multiple plagiarism cases in bulk for a specific assignment. Accessible only to lecturers and assistant lecturers assigned to the module.
§Path Parameters
module_id
: The ID of the parent moduleassignment_id
: The ID of the assignment containing the plagiarism cases
§Request Body
Requires a JSON payload with the following field:
case_ids
: Array of plagiarism case IDs to delete (must not be empty)
§Returns
Returns an HTTP response indicating the result:
200 OK
with success message and count of deleted cases400 BAD REQUEST
for invalid payload or missing cases403 FORBIDDEN
if user lacks required permissions500 INTERNAL SERVER ERROR
for database errors or deletion failures
The response body follows a standardized JSON format with a success message.
§Example Request
{
"case_ids": [12, 13, 17]
}
§Example Response (200 OK)
{
"success": true,
"message": "3 plagiarism cases deleted successfully"
}
§Example Responses
400 Bad Request
(empty case_ids)
{
"success": false,
"message": "case_ids cannot be empty"
}
400 Bad Request
(missing cases)
{
"success": false,
"message": "Some plagiarism cases not found or not in assignment: [17, 25]"
}
500 Internal Server Error
(transaction failure)
{
"success": false,
"message": "Transaction commit failed: [error details]"
}
§Notes
- This operation is atomic - either all cases are deleted or none
- Returns an error if any specified case doesn’t exist or belongs to a different assignment
- Only users with lecturer or assistant lecturer roles assigned to the module can perform this action