Skip to content

when space is created, add the creator to space as admin#180

Merged
lmarini merged 4 commits into
developfrom
api-create-spaces-not-visible
Mar 1, 2021
Merged

when space is created, add the creator to space as admin#180
lmarini merged 4 commits into
developfrom
api-create-spaces-not-visible

Conversation

@tcnichol
Copy link
Copy Markdown
Contributor

@tcnichol tcnichol commented Feb 25, 2021

Description

Previously, when a space was created using the api, the user that created the space was not added to the space as an admin upon creation. This meant that if a user created a space with a POST request and then used a GET request to get available spaces, the new space would not show up.

To test that this is fixed, create a space using POST (curl or postman) and then do a GET. Note that before the new space did not show up, but now it does.

Fixes #179

Review Time Estimate

  • When possible

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the CHANGELOG.md.
  • I have signed the CLA
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@tcnichol tcnichol linked an issue Feb 25, 2021 that may be closed by this pull request
Comment thread CHANGELOG.md Outdated
Copy link
Copy Markdown
Member

@bodom0015 bodom0015 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Works as expected:

MacBook-Pro:clowder lambert8$ curl localhost:9000/api/spaces -XPOST --header 'Content-Type: application/json' -d '{ "name": "created via API", "description": "I created this via the API" }' --header 'X-Api-Key: d890834f-9b1b-48a6-9935-ba79fa73dd49'
{"id":"60389efbd72872db4b17c3ed"}

MacBook-Pro:clowder lambert8$ curl localhost:9000/api/spaces --header 'Content-Type: application/json' --header 'X-Api-Key: d890834f-9b1b-48a6-9935-ba79fa73dd49'
[{"id":"60389efbd72872db4b17c3ed","name":"created via API","description":"I created this via the API","created":"Fri Feb 26 01:10:51 CST 2021"},
...
}]

@lmarini lmarini merged commit b512cb4 into develop Mar 1, 2021
@robkooper robkooper deleted the api-create-spaces-not-visible branch September 10, 2022 03:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

spaces created by api do not show up

4 participants