Updated README and Minor Changes
This commit is contained in:
parent
920bd4f77f
commit
f518df9d78
|
@ -9,7 +9,7 @@ def markStatus(request, id, email, user_type):
|
|||
try:
|
||||
data = request.data
|
||||
applications = PlacementApplication.objects.filter(placement_id=data[OPENING_ID]) # Getting All
|
||||
# application form db for this opening
|
||||
# application from db for this opening
|
||||
for i in data[STUDENT_LIST]:
|
||||
application = applications.filter(student_id=i[STUDENT_ID]) # Filtering student's application
|
||||
if len(application) > 0:
|
||||
|
@ -32,10 +32,13 @@ def markStatus(request, id, email, user_type):
|
|||
# This one needs to be created
|
||||
else:
|
||||
raise ValueError("Student - " + i[STUDENT_ID] + " didn't apply for this opening")
|
||||
return Response({'action': "Mark Status", 'message': "Marked Status"},
|
||||
status=status.HTTP_200_OK)
|
||||
|
||||
except ValueError as e:
|
||||
return Response({'action': "Mark Selected", 'message': str(e)},
|
||||
return Response({'action': "Mark Status", 'message': str(e)},
|
||||
status=status.HTTP_400_BAD_REQUEST)
|
||||
except:
|
||||
logger.warning("Mark Status: " + str(sys.exc_info()))
|
||||
return Response({'action': "Mark Stauts", 'message': "Error Occurred!"},
|
||||
return Response({'action': "Mark Status", 'message': "Error Occurred!"},
|
||||
status=status.HTTP_400_BAD_REQUEST)
|
||||
|
|
|
@ -7,7 +7,9 @@
|
|||
3. [**api/student/addResume/**](#apistudentaddresume)
|
||||
4. [**api/student/deleteResume/**](#apistudentdeleteresume)
|
||||
5. [**api/student/submitApplication/**](#apistudentsubmitapplication)
|
||||
3. [**Common Errors**](#common-errors)
|
||||
3. [**Admin APIs**](#admin-portal-apis)
|
||||
1. [**api/admin/markStatus/**](#apiadminmarkstatus)
|
||||
4. [**Common Errors**](#common-errors)
|
||||
|
||||
---
|
||||
|
||||
|
@ -390,6 +392,58 @@ You can see some common errors [here](#common-errors)
|
|||
|
||||
---
|
||||
|
||||
|
||||
# Admin Portal APIs
|
||||
|
||||
## `api/admin/markStatus`
|
||||
|
||||
This Api is used to mark the status for application for a specific placement.
|
||||
|
||||
### How to Use?
|
||||
|
||||
Send a `POST` request to `api/admin/markStatus`<br>
|
||||
Request_Body:
|
||||
|
||||
```json
|
||||
{
|
||||
"opening_id": "RIDNK323JD3JD",
|
||||
"student_list": [
|
||||
"DBJDH32JDDDRE",
|
||||
"HFJGJHE7JGDHE"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
> Headers <br>
|
||||
> Authorization: "Bearer {tokenID}"
|
||||
|
||||
### Response
|
||||
|
||||
Response is a Json with these fields
|
||||
|
||||
```json
|
||||
{
|
||||
"action": "Mark Status",
|
||||
"message": "Marked Status"
|
||||
}
|
||||
```
|
||||
|
||||
- action: Tells us about the message creator<Br>
|
||||
- message: Tells us what happened with our Request.
|
||||
|
||||
### Status Codes
|
||||
|
||||
The possible responses for this api request are as follows
|
||||
|
||||
| Status Codes | Possible Messages |
|
||||
| --------------- | ------------------------ |
|
||||
| 200 OK | `Marked Status` |
|
||||
| 400 BAD_REQUEST | `Error Occurred` |
|
||||
|
||||
You may see some different errors which can be seen [here](#common-errors)
|
||||
|
||||
---
|
||||
|
||||
## `Common Errors`
|
||||
|
||||
Some common errors that you may see while accessing the Apis
|
||||
|
@ -401,3 +455,5 @@ Some common errors that you may see while accessing the Apis
|
|||
| 401 UNAUTHORIZED | `Token has wrong audience` | You may be using wrong credentials for Google OAuth2.0. |
|
||||
| 404 NOT FOUND | `User Not Found. Contact CDC for more details` | You may not be a user at CDC, IIT Dharwad. Please contact us to get your user account |
|
||||
| 400 BAD_REQUEST | `Error Occurred {error}` | Any random Error which can be seen in the {error} string. |
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue