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

[front-end] Define a Common Interface for Front-end API Requests #812

Open
DietBepis1 opened this issue Nov 25, 2023 · 1 comment
Open

Comments

@DietBepis1
Copy link
Collaborator

Description

In the same way that we are creating presenters and library wrappers for the server-side, we should define wrapper for our own API instead of having axios calls everywhere -- an APIPresenter, if you will.

You'll see a comment under this description that points to a new branch once you assign yourself to this issue. Please do your development in that branch. It is part of our new metric collecting.

Spec

In this issue, we will create a class or module called API (or something) that can take in a reference to a path and an api version. We should use the same pattern of extending errors to have a matching error also. There's a demo of what this could look like here. Feel free to use that as a skeleton, but make sure you test it because I wrote it more as a pseudo-code example.

You may also need to do some refactoring for control panel specific issues as part of this issue, depending on how far other components are in development. Don't worry about moving every api over, just the new stuff

Copilot Prompts

How can I mock an API response in Jest?
How do I extend a Javascript error for custom error handling?
What are the conventions around using Vuex for all asynchronous calls?

Target Date: 12/31/2023 📆

@mianmiantea2019 mianmiantea2019 self-assigned this Nov 30, 2023
@Dunridge
Copy link
Collaborator

Branch: issue-812

@manishapriya94 manishapriya94 changed the title Define a Common Interface for Front-end API Requests [front-end] Define a Common Interface for Front-end API Requests Jan 17, 2024
@mianmiantea2019 mianmiantea2019 removed their assignment May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

3 participants