curl --request PUT \
--url http://localhost:5000/api/application/approve/64b3e7a2f1c0d2e3a4b5c6d7
{
"_id": "64b3e7a2f1c0d2e3a4b5c6d7",
"studentId": "64a1f2c3e4b0d5f6a7b8c9d0",
"teacherId": "64a1f2c3e4b0d5f6a7b8c9d1",
"type": "LEAVE",
"message": "I need to take a leave of absence from January 20 to January 25.",
"status": "APPROVED",
"__v": 0
}
Applications
Approve application
Approve a pending application by its ID.
PUT
/
api
/
application
/
approve
/
{id}
curl --request PUT \
--url http://localhost:5000/api/application/approve/64b3e7a2f1c0d2e3a4b5c6d7
{
"_id": "64b3e7a2f1c0d2e3a4b5c6d7",
"studentId": "64a1f2c3e4b0d5f6a7b8c9d0",
"teacherId": "64a1f2c3e4b0d5f6a7b8c9d1",
"type": "LEAVE",
"message": "I need to take a leave of absence from January 20 to January 25.",
"status": "APPROVED",
"__v": 0
}
Updates an existing application’s status to
APPROVED. The application is located by its MongoDB ObjectId supplied as a path parameter.
No authentication is required to call this endpoint.
Path parameters
The MongoDB ObjectId of the application to approve.
Response
Returns the updated application object withstatus set to APPROVED.
The unique MongoDB ObjectId of the application.
The MongoDB ObjectId of the student who submitted the application.
The MongoDB ObjectId of the teacher the application is addressed to.
The application category (e.g.,
LEAVE, COMPLAINT, REQUEST).The application message body.
The updated status of the application. Always
APPROVED after a successful call.Internal MongoDB document version key.
If the provided
id does not match any application, the server will return null. Ensure the ObjectId is valid and exists before calling this endpoint.curl --request PUT \
--url http://localhost:5000/api/application/approve/64b3e7a2f1c0d2e3a4b5c6d7
{
"_id": "64b3e7a2f1c0d2e3a4b5c6d7",
"studentId": "64a1f2c3e4b0d5f6a7b8c9d0",
"teacherId": "64a1f2c3e4b0d5f6a7b8c9d1",
"type": "LEAVE",
"message": "I need to take a leave of absence from January 20 to January 25.",
"status": "APPROVED",
"__v": 0
}
⌘I