This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rest API batching support (2) (#4075)
* Add batch route * Register batch route * Allow batching on writable endpoints * Batch in client * Batch non-GET requests * Batching support with typescript defs * Remove unused hook * Prevent multiple fragment updates * Only use batch route if detected * Correct var name * Move nonce check to validate_callback so it runs before requests are completed * remove unused imports * updateCartFragments function as const * Add phpunit tests for batching functionality * Reduce batch delay * increase timeout * Update isCartUpdatePostRequest for batch support * Update Endpoint used in test * Move nonce check back inline - custom headers are not returned otherwise * Fix error handling * Back to 30s * Update assets/js/middleware/cart-update.ts Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com> * whitespace Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
- Loading branch information
1 parent
71aeaff
commit fdc74b8
Showing
33 changed files
with
639 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { triggerFragmentRefresh } from '@woocommerce/base-utils'; | ||
|
||
/** | ||
* Default export for registering the controls with the store. | ||
* | ||
* @return {Object} An object with the controls to register with the store on the controls property of the registration object. | ||
*/ | ||
export const controls = { | ||
UPDATE_LEGACY_CART_FRAGMENTS() { | ||
triggerFragmentRefresh(); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.