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 an API endpoint for inserting a new role #186

Open
jaytula opened this issue Sep 25, 2021 · 0 comments
Open

Create an API endpoint for inserting a new role #186

jaytula opened this issue Sep 25, 2021 · 0 comments
Labels
Back End Focused on Back End (Express / Postgres / Docker) Enhancement Improves or adds something

Comments

@jaytula
Copy link
Contributor

jaytula commented Sep 25, 2021

This issue requires #184 to be resolved before it can be done.

We need an endpoint added in Next for inserting a new role to the roles table. It would be with the apis in the admin/roles folder and create.ts file.
That structure will give us the desired endpoint /api/admin/roles/create.

It should accept a POST request with a JSON body like:

{
  "name": "admin"
}

Note that this endpoint's access has to be restricted by either permissions or roles at some point.

As there isn't a UI at the moment, test that the endpoint is working with Postman or curl

@ZumDeWald ZumDeWald added Enhancement Improves or adds something Front End Focused on Front End code (NextJS / Styled Components) hacktoberfest-accepted Accept for Hacktoberfest, will merge after review Back End Focused on Back End (Express / Postgres / Docker) and removed Front End Focused on Front End code (NextJS / Styled Components) hacktoberfest-accepted Accept for Hacktoberfest, will merge after review labels Sep 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Back End Focused on Back End (Express / Postgres / Docker) Enhancement Improves or adds something
Projects
None yet
Development

No branches or pull requests

2 participants