Update the status of a shift. Set a shift to OPEN or CLOSED. Before updating a shift, the user must locate an existing shift by the ID.
PATCH
{server_url}/shifts/{id}
| Key | Value |
|---|---|
| Content-Type | application/json |
| Property name | Type | Description |
|---|---|---|
id |
number | The unique ID assigned to the shift. |
status |
string | The shift is Open (waiting to fill the positon) or Closed (the positon is no longer available). |
{
"status": "closed"
}
curl --location --request PATCH 'http://localhost:3000/shifts/df91' \
--header 'Content-Type: application/json' \
--data '{
"status": "closed"
}'
{
"id": "df91",
"date": "2024-07-21",
"start_time": "0700",
"shift_length": "6",
"warning": "opening",
"location_detail": "Eatons Centre",
"status": "closed"
}
| Status value | Return status | Description |
|---|---|---|
| 200 | Success | Requested data returned successfully |
| 404 | Error | Specified user record not found |
| ECONNREFUSED | N/A | Service is offline. Start the service and try again. |