Function bulk_delete_assignments

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

DELETE /api/modules/:module_id/assignments/bulk

Bulk delete multiple assignments by ID within a module. Only accessible by lecturers or admins assigned to the module.

§Path Parameters

  • module_id (i64): The ID of the module containing the assignments

§Request Body (JSON)

{
  "assignment_ids": [123, 124, 125]
}

§Success Response (200 OK)

{
  "success": true,
  "data": {
    "deleted": 2,
    "failed": [
      { "id": 125, "error": "Assignment 125 in module 1 not found" }
    ]
  },
  "message": "Deleted 2/3 assignments"
}