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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(adminform): extract get collaborators #1762

Merged

Conversation

seaerchin
Copy link
Contributor

@seaerchin seaerchin commented Apr 29, 2021

Problem

Currently, our /adminform endpoint is returning the full adminform object. This endpoint has alot of responsibilities and this pr shards out the responsibility of returning the collaborators to the individual endpoints.

Closes #1497

Solution

This PR adds a new endpoint for GET /admin/form/collaborators, which is solely responsible for returning the slice of the form state that holds the collaborators

@seaerchin seaerchin changed the base branch from develop to refactor/update-form-collab April 29, 2021 09:35
@seaerchin seaerchin changed the title refactor(wip - adminform): extract get collaborators refactor(adminform): extract get collaborators Apr 29, 2021
@seaerchin seaerchin requested review from karrui and mantariksh and removed request for karrui April 29, 2021 10:01
@seaerchin seaerchin force-pushed the refactor/extract-get-collaborators branch from 6f22595 to 10f8491 Compare May 5, 2021 06:17
@seaerchin seaerchin merged commit 87119cc into refactor/update-form-collab May 5, 2021
@seaerchin seaerchin deleted the refactor/extract-get-collaborators branch May 5, 2021 06:24
seaerchin added a commit that referenced this pull request May 5, 2021
* feat(form/server/model): adds method to updateFormCollaborators

* feat(form/types; admin-form/service): adds service method for updating collaborators; adds typings

* feat(admin-forms/settings/routes): adds controller and handler for updating collaborators of a form

* feat(public/service): adds method on AdminFormService to update collaborators

* refactor(collaborator-modal.client.controller): replaces old call with new AdminFormService call

* docs(admin-forms): fixed typos in handleUpdateCollaborators

* test(tests): adds unit tests for form model, admin form service and admin form controller

* refactor(admin-form/controller): changed unknown on joi vaildator to optional

* refactor(types): adds _id to the type of Permission

* refactor(admin-form/collaborators): updated dto to be just an array; error message extraction fixed

* fix(collaborator-modal/client/controller): fixed fe callsites showing celebrate errors

* fix(collaborator-modal/client/controller): fixed error caused by accidental auto import

* refactor(admin-form/controller): changed to use .json and formCollaborators is properly selected

* test(form/server/model/spec): changed test to use .rejects()

* style(collaborator-modal/client/controller): updated error message

* test(admin-forms): integration tests for updating of collaborators (#1753)

* test(admin-forms/settings): integration tests for updating of collaborators

* docs(admin-forms/settings/test): updated comment for test

* test(admin-form/settings/routes/spec): updated tests for new shape

* docs(admin-form/settings/routse/spec): updated http verb to PUT

* refactor(adminform): extract get collaborators (#1762)

* feat(admin-form/controller): added new route and controller for GET admin-form/collaborators

* feat(admin-form/controller): adds new GET admin/form/collaborators endpoint

* test(admin-form/controller): adds unit tests for new endpoint

* test(admin-form/controller): fixed email domain in tests being from gov

* chore(admin-form/collaborators): updated docs and changed from res.send to res.json

* test(admin-forms/settings/routes): added integration tests for GET /collaborators (#1777)

* chore(admin-forms/settings/routes/spec): removed double import
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.

2 participants