Skip to content

Reduce boilerplate for API request and snackbar update #2151

@samfreund

Description

@samfreund

This "make api request -> update a snack bar" pattern feels pretty similar to other places in our code. Should we look to reduced code duplication between our other HTTP handlers?

Originally posted by @mcm001 in #2150 (comment)

We should write a function that takes an API endpoint and the JSON payload, then does all of the checking status and snackbar operations.

Note that for instances where this happens might be strange, as axios.post typically has post on the next line down.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestfrontendHaving to do with PhotonClient and its related itemsgood first issueGood for newcomers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions