Skip to content

Latest commit

 

History

History
80 lines (61 loc) · 1.28 KB

update-instructor.md

File metadata and controls

80 lines (61 loc) · 1.28 KB

Update Instructor

Updates the Instructor.

URL : /api/instructors/:id

URL Parameters : id=[long]

Method : PUT

Sample Request Body (PermanentInstructor)

{
    "phoneNumber": "+905055557556",
    "name": "updatePI1",
    "address": "updatePI1Address",
    "fixedSalary": 7975.22
}

Sample Request Body (VisitingResearcher)

{
    "phoneNumber": "+905055557555",
    "name": "updateVS2",
    "address": "updateVS2Address",
    "hourlySalary": 66.43
}

Success Response

Code : 204 NO CONTENT

Error Responses

Code : 400 BAD REQUEST

Sample Response Body :

{
    "success": false,
    "message": "An invalid entity type error has occurred.",
    "errors": [
        "The type of the submitted model is not of type 'VisitingResearcher'."
    ]
}

Code : 404 NOT FOUND

Sample Response Body :

{
    "success": false,
    "message": "No Records Found.",
    "errors": [
        "PermanentInstructor not found for parameters {id='2'}."
    ]
}

Code : 409 CONFLICT

Sample Response Body :

{
    "success": false,
    "message": "A unique constraint error has occurred.",
    "errors": [
        "'phoneNumber' must be unique. {rejectedValue: +905055557555}"
    ]
}