ok icon indicating copy to clipboard operation
ok copied to clipboard

feat: add enrollment put/delete API routes

Open chrononyan opened this issue 2 years ago • 0 comments

These models still confuse me.

GET /api/v3/course/<offering>/enrollment/<email>

$ curl 'http://127.0.0.1:5000/api/v3/course/cal/cs61a/sp16/enrollment/[email protected]?access_token=access1'
{
    "code": 200,
    "data": {
        "class_account": "",
        "role": "staff",
        "section": "",
        "user": {
            "email": "[email protected]",
            "id": "asdf"
        }
    },
    "message": "success"
}

DELETE /api/v3/course/<offering>/enrollment/<email> works the same as the frontend batch-enroll-CSV

$ curl 'http://127.0.0.1:5000/api/v3/course/cal/cs61a/sp16/enrollment/[email protected]?access_token=token' -X DELETE
{
    "code": 200,
    "data": {},
    "message": "success"
}

PUT /api/v3/course/<offering>/enrollment works the same as the frontend batch-enroll-CSV

$ curl 'http://127.0.0.1:5000/api/v3/course/cal/cs61a/sp16/enrollment?access_token=token' -X PUT -H 'Content-Type: application/json' -d '{"role":"student","csv":"[email protected],Staff,,,"}'
{
    "code": 200,
    "data": {
        "new": 1,
        "updated": 0
    },
    "message": "success"
}

chrononyan avatar Sep 29 '21 02:09 chrononyan