Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Salesforce D2C as a data source (#372)
* Replace Salesforce b2c with d2c * Fix a missing product_id field * Skip empty search queries, and map the name correctly * Use the constant instead of the hardcoded value * Use null coalescing Co-authored-by: Chris Zarate <[email protected]> * Safety when returning the token Co-authored-by: Chris Zarate <[email protected]> * Remove the unnecessary memo * Attempt to only fire the fetch for required variables * Got the search and productId queries working * Fix the search and productId lookups * Add support for token expiry * Strengthen the empty query checks * Simplify the search query check, fix the expiry time and add more comments * Add an additional layer of checks for subsequent fetches * Fix the search functionality, and ensure missing required variables don't fire queries * Refactor the salesforce setup screen to be a lot more user friendly * Move the auth call to the server and simplify the setup page * Fix the docblock and the unsafe use of wp_remote_get * Center-align "Salesforce D2C" text in "Connect New" menu * Add error state and fix bugs in useRemoteData * Fix type error: Names are optional * Separate logic for initial fetch and refetch * Fix comment * PR Feedback * Add more validation for the domain of the salesforce url --------- Co-authored-by: Chris Zarate <[email protected]> Co-authored-by: Alec Geatches <[email protected]>
- Loading branch information