-
Notifications
You must be signed in to change notification settings - Fork 14
holiday
Rohin Awale edited this page Jul 16, 2019
·
5 revisions
METHOD | ROUTES | DESCRIPTION | ALLOWED USERS |
---|---|---|---|
POST | /v1/api/holidays/create | allows admin/HOD to add holiday | Only admin/HOD |
{
"status": true,
"payload": {
"title": "Test",
"from_date": "2019-07-18",
"to_date": "2019-07-19",
"description": "test holiday",
"image": "http://localhost:8000/static/lms_user/images/yay.png"
}
}
METHOD | ROUTES | DESCRIPTION | ALLOWED USERS |
---|---|---|---|
GET | /v1/api/holidays | allows users to view holidays | All Authorized Users |
A call to this API Method will display list of holidays
{
"status": true,
"data": [
{
"id": 3,
"title": "Tihar",
"date": "2019-10-27",
"days": 103,
"image": "http://localhost:8000/static/lms_user/site-data/holidays/nepal-light-festival.jpg"
},
{
"id": 4,
"title": "Dashain",
"date": "2019-09-29",
"days": 75,
"image": "http://localhost:8000/static/lms_user/site-data/holidays/tika-jamara.jpg"
},
{
"id": 5,
"title": "Test",
"date": "2019-07-18",
"days": 2,
"image": "http://localhost:8000/static/lms_user/images/yay.png"
}
]
}
METHOD | ROUTES | DESCRIPTION | ALLOWED USERS |
---|---|---|---|
POST | /v1/api/holidays/update/<int:id>
|
allows admin/HOD to update/edit holiday | Only admin/HOD |
{
"status": true,
"payload": {
"id": 5,
"title": "Test 2",
"from_date": "2019-07-19",
"to_date": "2019-07-19",
"description": "Updating Test Holiday",
"image": "http://localhost:8000/static/lms_user/images/yay.png"
}
}
METHOD | ROUTES | DESCRIPTION | ALLOWED USERS |
---|---|---|---|
POST | /v1/api/holidays/delete/<int:id>
|
allows admin/HOD to update/edit holiday | Only admin/HOD |
{
"status": true,
"payload": "Holiday deleted sucessfully"
}