Closed Eldemarkki closed 1 year ago
This PR adds a status field to the response of GET /friends/list and POST /friends/add showing the current heartbeat status of that friend.
status
GET /friends/list
POST /friends/add
Getting the current heartbeat could be refactored into its own function, but I wasn't sure where to place that so I just copy-pasted it.
Example responses: POST /friends/add:
{ "username": "testuser2", "coding_time": { "all_time": 0, "past_month": 0, "past_week": 0 }, "status": { "started": "2023-02-21T00:52:56.083467079", "duration": 5, "heartbeat": { "project_name": null, "language": null, "editor_name": null, "hostname": null } } }
GET /friends/list:
[ { "username": "testuser2", "coding_time": { "all_time": 0, "past_month": 0, "past_week": 0 }, "status": { "started": "2023-02-21T01:03:04.610385534", "duration": 3, "heartbeat": { "project_name": null, "language": null, "editor_name": null, "hostname": null } } } ]
Also please update the documentation.
This PR adds a
status
field to the response ofGET /friends/list
andPOST /friends/add
showing the current heartbeat status of that friend.Getting the current heartbeat could be refactored into its own function, but I wasn't sure where to place that so I just copy-pasted it.
Example responses:
POST /friends/add
:GET /friends/list
: