Skip to content

Modify card reader endpoints to allow for alias editing #1898

@adarshm11

Description

@adarshm11

Office access cards currently have an "alias" property that gives a unique name to each registered card in the form of [adjective] [noun]. However this is arbitrary and it would help to allow officers to edit their card's alias so they can better track its activity. So we need to update both the frontend page and the backend routes to allow for this.

The Gameplan

  • create an endpoint in /api/main_endpoints/routes/OfficeAccessCard.js called "/edit" that expects a post request, with a json body containing the updated alias and document _id, then updates the MongoDB document for that alias
  • add a pencil (edit) button to the frontend page's table at /src/Pages/CardReader/CardReader.js so that, when clicked, the alias can be edited. when in edit mode, the pencil/edit button changes to a "save" button, and clicking save calls the /changeAlias api route
  • include tests to see if the endpoint works as intended to change the alias of a dummy document

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions