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

Invalidate and refresh customer data sections on HTTP DELETE requests #9034

Merged
merged 1 commit into from
Mar 31, 2017
Merged

Invalidate and refresh customer data sections on HTTP DELETE requests #9034

merged 1 commit into from
Mar 31, 2017

Conversation

Vinai
Copy link
Contributor

@Vinai Vinai commented Mar 28, 2017

The customer-data sections are invalidated and updated whenever a state changing request is sent to Magento.
Currently this happens for POST and PUT requests. However, DELETE is also a state modifying HTTP method, so it would be good if the customer data sections where updated in case of such a request, too.
Otherwise ugly workarounds with POST or PUT to special endpoints like /rest/V1/foo/123/delete have to be created.

Description

This PR updates the client side customer-data model to also invalidate and update the section data for DELETE requests.

I think this is a backward compatible change.

Manual testing scenarios

  • Create a REST endpoint that is configured to respond to DELETE requests.
  • Create a customer data section that is linked to that REST endpoint URL path.
  • Create a JavaScript module that uses the customer-data section and triggers the DELETE request.

Expected outcome:
The customer data section observable updates after the DELETE request.

Actual outcome:
The customer data section is not refreshed.

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@ishakhsuvarov ishakhsuvarov self-assigned this Mar 29, 2017
@ishakhsuvarov ishakhsuvarov added this to the March 2017 milestone Mar 29, 2017
@magento-team magento-team merged commit a06bdea into magento:develop Mar 31, 2017
magento-team pushed a commit that referenced this pull request Mar 31, 2017
@okorshenko
Copy link
Contributor

@Vinai thank you for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants