Skip to content

Commit

Permalink
Correct 'location' element name in /api/v1/users/connections.
Browse files Browse the repository at this point in the history
Add documentation for /api/v1/users/connections
  • Loading branch information
Misterblue committed Nov 3, 2020
1 parent cfdaf53 commit e4a58ca
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
36 changes: 36 additions & 0 deletions docs/API-Users.md
Expand Up @@ -149,6 +149,42 @@ Set a user as a friend. The other use must already have a "connection" with this
## DELETE /api/v1/user/connections/{username}
## GET /api/v1/user/connection_request

## GET /api/v1/users/connections

```
{
"status": "success",
"data": {
"users": [
{
"username": string,
"connection": string, // either "is_friend" or "is_connection"
"images": {
"thumbnail": URLstring,
"hero": URLstring,
"tiny": URLstring
},
"location": {
"node_id": locationNodeId,
"root": {
"id": stringDomainId,
"name": stringDomainName,
"network_address": stringNetworkAddress,
"network_port": numberPort,
"ice_server_address": stringNetworkAddress,
"time_of_last_heartbeat": stringISODate,
"num_users": numberUsers
},
"path": stringAddress,
"online": boolean
}
},
...
]
}
}
```

---

# Administrative
Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/v1/users/connections.ts
Expand Up @@ -49,7 +49,7 @@ const procGetUsersConnections: RequestHandler = async (req: Request, resp: Respo
'username': connectionUsername,
'connection': SArray.has(req.vAuthAccount.friends, connectionUsername) ? 'is_friend' : 'is_connection',
'images': await buildImageInfo(aAccount),
'placeName': await buildLocationInfo(aAccount)
'location': await buildLocationInfo(aAccount)
});
}
else {
Expand Down

0 comments on commit e4a58ca

Please sign in to comment.