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

Change create product route to POST /api/products #502

Merged
merged 3 commits into from
Apr 18, 2024

Conversation

rachel-carvalho
Copy link
Contributor

@rachel-carvalho rachel-carvalho commented Apr 18, 2024

WHY are these changes introduced?

We want to perform mutations with a POST instead of a GET.

WHAT is this pull request doing?

  • Changed GET /api/products/create to POST /api/products
  • Point web/frontend submodule to the commit which updates fetch call Change create product route to POST /api/products shopify-frontend-template-react#259
  • Added /api/products and /api/products/count to the VerifyCsrfToken middleware's list of excepted paths
  • Removed variants field from populateProduct mutation because it's not valid anymore
  • Added a check of errors in the response body in addition to HTTP status code because most GraphQL failures still return HTTP 200 ok
18-28-8s4xt-jwa5u.mov

Checklist

Note: once this PR is merged, it becomes a new release for this template.

  • I have added/updated tests for this change N/A
  • I have made changes to the README.md file and other related documentation, if applicable N/A

@rachel-carvalho rachel-carvalho self-assigned this Apr 18, 2024
@rachel-carvalho rachel-carvalho force-pushed the change_create_products_to_post branch from a94e544 to fa1e24a Compare April 18, 2024 18:45
@rachel-carvalho rachel-carvalho merged commit 6d12ebd into main Apr 18, 2024
7 checks passed
@rachel-carvalho rachel-carvalho deleted the change_create_products_to_post branch April 18, 2024 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants