Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

add org.update endpoint #74

Merged
merged 2 commits into from Mar 30, 2019
Merged

add org.update endpoint #74

merged 2 commits into from Mar 30, 2019

Conversation

nikosrossolatos
Copy link
Contributor

@nikosrossolatos nikosrossolatos commented Mar 26, 2019

Fixes #73

checkOrgExists

Since no org.getInfo endpoint existed, instead of creatin it i added an extra service checkOrgExists as a named export. It might be likely that we need a getOrgInfo in the future, but creating it just to use the service in this case seemed kind of an overkill.

I also thought about using the isUserAuthorised function to bail early if the user has no yeep.org.write permissions for the provided org id and then check the existance of the given org inside the service, but this wasn't so clean and it would be harder to test.

Please advise if you would prefer a different method.

OrgMemberships

Since the orgMemberships model only uses id references i didn't make any changes there.

Edit: Bear in mind that i didn't remove the '/v1/' from the docs for this endpoint. We need to make a good passthrough to all of them and i didn't want this file to miss out 馃棥

Edit2: I added the extra unauthorisedOrg inside the beforeAll loop. This would be better off inside the only test that is using it, but if the test fails before the org is deleted, then the database needs reset. It is ugly but it was worse if i left it inside the unit test.

@nikosrossolatos nikosrossolatos added the enhancement New feature or request label Mar 26, 2019
@nikosrossolatos nikosrossolatos self-assigned this Mar 26, 2019
docs/methods/org.update.md Outdated Show resolved Hide resolved
docs/methods/org.update.md Outdated Show resolved Hide resolved
docs/methods/org.update.md Outdated Show resolved Hide resolved
server/api/org/update/controller.js Show resolved Hide resolved
server/api/org/update/controller.js Show resolved Hide resolved
server/api/org/update/controller.js Outdated Show resolved Hide resolved
server/api/org/update/controller.js Show resolved Hide resolved
@nikosrossolatos
Copy link
Contributor Author

@jmike if we don't proceed with the extra validation checks because of the circular dependancy above then this PR is ready to be merged

server/api/org/update/controller.js Show resolved Hide resolved
@nikosrossolatos nikosrossolatos merged commit e665445 into master Mar 30, 2019
@nikosrossolatos nikosrossolatos deleted the addon/orgUpdate branch March 30, 2019 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants