amplify icon indicating copy to clipboard operation
amplify copied to clipboard

Create Admin Rest endpoints

Open DietBepis1 opened this issue 2 years ago • 6 comments

Description

For our new control panel feature, we will need to create some rest endpoints that will handle our new admin model. These will need to be under the v1 endpoint schema, which may or may not be made by the time this is worked on 😉 . Endpoints should consume JSON.

Dependencies

  • [x] #600

Spec

We need to create:

  • [ ] GET /v1/admins; Gets a list of admins

  • [ ] POST /v1/admins; Given a single bit of JSON, or an array of JSON, create n admin entries

  • [ ] PUT /v1/admins/:id; Given an id and a JSON payload, update the modified fields of the admin whose id was given

  • [ ] DELETE /v1/admins/:id Given an id, delete the admin entry

Each of these endpoints should also have appropriate testing!

Copilot Prompts

Help me write a(n) <insert http verb> endpoint using ExpressJS.

Explain how Express routes requests.

How can I group express endpoints with a version?

Target Date: 11/15/23 📆

DietBepis1 avatar Oct 12 '23 00:10 DietBepis1

Hi @DietBepis1, I'd like to take this on if that's ok!

XicaFelix avatar Oct 20 '23 15:10 XicaFelix

@xica, pick one endpoint to focus on and you're good! This relies on the admin table which is also under development, but you can look at that issue for the schema and create a temporary db migration to test locally.

DietBepis1 avatar Oct 22 '23 01:10 DietBepis1

@DietBepis1 Sounds good, I'll take the Get Admins endpoint

XicaFelix avatar Oct 22 '23 02:10 XicaFelix

Hi @DietBepis1, I'd like to give the PUT admins endpoint a try please.

Justin-Quinn51 avatar Oct 25 '23 03:10 Justin-Quinn51

Hi @DietBepis1 I'll work on the POST endpoints!

jayaruhbee avatar Oct 25 '23 18:10 jayaruhbee

Hi, @DietBepis1 I'll work on the DELETE endpoint.

Figaro0414 avatar Oct 25 '23 19:10 Figaro0414