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

Add promise returns for controller methods. #61

Merged
merged 2 commits into from
Sep 2, 2021

Conversation

shangzhel
Copy link
Collaborator

I realized there was no way for components to know whether an action had succeeded. This PR adds return values to networked methods that carry the status of HTTP responses. Components can await calls to the controllers and show error indicators on failure.

  • IAppContext.login() and IAppContext.logout() now return Promise<ResponseStatus>
  • ICard.commit() and ICard.delete() now return Promise<ResponseStatus>
  • ResponseStatus is a subset of Response that carries only the values of ok, status and statusText.

@shangzhel shangzhel added the enhancement New feature or request label Sep 1, 2021
@shangzhel shangzhel added this to the Sprint 1 milestone Sep 1, 2021
@shangzhel shangzhel self-assigned this Sep 1, 2021
@shangzhel shangzhel added this to In progress in Sprint 1 via automation Sep 1, 2021
@shangzhel shangzhel added this to Sprint 1 in Product backlog via automation Sep 1, 2021
@shangzhel shangzhel mentioned this pull request Sep 1, 2021
21 tasks
Copy link
Collaborator

@waltervan00 waltervan00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming that login in AppContext is currently a stub for React to use. Looks fine.

Copy link
Owner

@chomosuke chomosuke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@shangzhel shangzhel merged commit 2df86ec into master Sep 2, 2021
Sprint 1 automation moved this from In progress to Done Sep 2, 2021
Product backlog automation moved this from Sprint 1 to Sprint 1 Done Sep 2, 2021
@shangzhel shangzhel deleted the shangzhel/controller-promise branch September 2, 2021 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Product backlog
  
Sprint 1 Done
Sprint 1
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants