Open
Description
These apis can be converted into one single api.
Currently, we have three separate API endpoints for initiating certificate-related tasks:
enable_certificate_generation
- enables or disables self-generated certificates for students.
start_certificate_generation
– starts generation for all enrolled students.
start_certificate_regeneration
– regenerates certificates based on provided certificate_statuses.
All endpoints perform similar operations (triggering background tasks for a course), but differ slightly in required input and logic. To simplify API usage, reduce duplication, and improve maintainability, we propose merging both endpoints into a single unified API.
Proposed Changes:
Introduce a unified API endpoint:
/certificate_task/<course_id>
Use a mode parameter in POST data to determine the action:
generate
regenerate
toggle
You'll also need to update the frontend code to replace all usages of the old endpoints with the new unified API.
Metadata
Metadata
Assignees
Labels
No labels