Skip to content

Commit

Permalink
docs updated
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmenendez committed Aug 21, 2024
1 parent 4f4e937 commit b6833aa
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
26 changes: 24 additions & 2 deletions api/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,30 @@ Only the following parameters can be changed. Every parameter is optional.

| HTTP Status | Error code | Message |
|:---:|:---:|:---|
| `401` | `40001` | `user not authorized` |
| `400` | `40004` | `malformed JSON body` |
| `400` | `40009` | `organization not found` |
| `400` | `40010` | `malformed URL parameter` |
| `400` | `4012` | `no organization provided` |
| `500` | `50002` | `internal server error` |

### 🧑‍🤝‍🧑 Organization members

* **Path** `/organizations/{address}/members`
* **Method** `GET`
* **Response**
```json
[
{
"info": { /* user info response */ },
"role": "admin"
}
]
```

* **Errors**

| HTTP Status | Error code | Message |
|:---:|:---:|:---|
| `400` | `40009` | `organization not found` |
| `400` | `40010` | `malformed URL parameter` |
| `400` | `4012` | `no organization provided` |
| `500` | `50002` | `internal server error` |
4 changes: 2 additions & 2 deletions api/organizations.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (a *API) organizationInfoHandler(w http.ResponseWriter, r *http.Request) {
// get the organization info from the request context
org, parent, ok := a.organizationFromRequest(r)
if !ok {
ErrUnauthorized.Write(w)
ErrNoOrganizationProvided.Write(w)
return
}
// send the organization back to the user
Expand All @@ -109,7 +109,7 @@ func (a *API) organizationMembersHandler(w http.ResponseWriter, r *http.Request)
// get the organization info from the request context
org, _, ok := a.organizationFromRequest(r)
if !ok {
ErrUnauthorized.Write(w)
ErrNoOrganizationProvided.Write(w)
return
}
// send the organization back to the user
Expand Down

0 comments on commit b6833aa

Please sign in to comment.