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

Create endpoint to get and update Partner admins #340

Closed
5 tasks
eleanorreem opened this issue Oct 13, 2023 · 4 comments
Closed
5 tasks

Create endpoint to get and update Partner admins #340

eleanorreem opened this issue Oct 13, 2023 · 4 comments
Assignees
Labels
complexity: moderate Time needed to do this ticket will be moderate e.g. 1-2 days feature/enhancement New feature or request hacktoberfest Hacktoberfest issues

Comments

@eleanorreem
Copy link
Contributor

eleanorreem commented Oct 13, 2023

Overview

We need to restrict access to users who are no longer partner admins. However, we want to keep the history of whether a user is a partner admin. We have created an active column in the partner admin table.

In bloom-frontend there is a Super Admin dashboard on /admin/dashboard. This feature will loosely follow the pattern of the UpdateTherapyAdminForm in Bloom-frontend.

What our new admin form will need is:

  • Access to the GET /user point. The Get user endpoint query will need to be able to include the partner admin table and filter by whether the partner admin row exists or not. i.e. you would get a searchQuery which might have
    { "relations": ["partner-admin"], "partnerAdmin": { "partnerAdminId": "IS NOT NULL"} }
    Note that this endpoint should now optionally return a users partnerAdmin data.
  • A PATCH endpoint /partner-admin/:id which takes a body with the updates to make. Please ensure this is behind Super Admin Authentication. In this case the body will be
    { "active": Boolean }

These changes should unblock this issue on Bloom-frontend.

Action Items

  • Take a look at the implentation of GET /user and PATCH /partner-access/:id. You will be following the implementations of these endpoints
  • Make the changes listed above to the GET /user endpoint and service methods and write adequate service tests and optional controller test
  • Create a PATCH /partner-admin/:id endpoint and with service method. This should be super admin authenticated that takes the body stated above. Ensure the appropriate DTO is created as well.
  • Commit and Push to your branch
  • Tag @eleanorreem in your PR
@eleanorreem eleanorreem added feature/enhancement New feature or request complexity: moderate Time needed to do this ticket will be moderate e.g. 1-2 days hacktoberfest Hacktoberfest issues labels Oct 13, 2023
@jobayer12
Copy link
Contributor

@eleanorreem I would like to work on this task.

@kyleecodes
Copy link
Member

@jobayer12 thanks for your interest, you are assigned! :)

@jobayer12
Copy link
Contributor

@kyleecodes @eleanorreem Is it possible to share the local environment database? Because I haven't any data in my local database that's why I can't test it properly. It would be nice if anyone shared it with me. I can work properly on the next task.

@kyleecodes
Copy link
Member

@jobayer12 Thanks for your interest!

Yes here is the link. You can skip to the section on Bloom Backend where you'll see a file download for our testing db.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity: moderate Time needed to do this ticket will be moderate e.g. 1-2 days feature/enhancement New feature or request hacktoberfest Hacktoberfest issues
Projects
None yet
Development

No branches or pull requests

3 participants