From f628d022f5dc9a5739eb06f80e284820429085cd Mon Sep 17 00:00:00 2001 From: Roland Bernard <rolbernard@unibz.it> Date: Sat, 19 Jun 2021 17:53:01 +0200 Subject: [PATCH] Finished the API documentation --- docs/api/work.md | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/docs/api/work.md b/docs/api/work.md index bc25cb9..5d9a73d 100644 --- a/docs/api/work.md +++ b/docs/api/work.md @@ -1 +1,48 @@ ## Work + +### GET `/work` [requires authentication] + +Get the information on the currently open work item of the authenticated user. If no item is open, +404 will be returned. + +#### Response body + +```typescript +interface Body { + status: string; + work: { + id: string; + task: string; + user: string; + started: number; + finished?: number; + }; +} +``` + +### POST `/work/start` [requires authentication] + +Create a new work item with the given data. All open work items for the authenticated user will +also be closed in turn. On successful creation the id of the new work item will be returned. + +#### Request body + +```typescript +interface Body { + task: string; +} +``` + +#### Response body + +```typescript +interface Body { + status: string; + id: string; +} +``` + +### PUT `/work/finish` [requires authentication] + +Finish the currently open work of the authenticated user. If no item is open, 404 will be returned. + -- GitLab