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

Feat/add to cart #21

Merged
merged 5 commits into from
Nov 24, 2023
Merged

Feat/add to cart #21

merged 5 commits into from
Nov 24, 2023

Conversation

DuvCharles
Copy link
Collaborator

No description provided.

Base automatically changed from feat/get-cart to sylext-v2 November 21, 2023 16:13
@DuvCharles DuvCharles changed the title WIP Feat/add to cart Feat/add to cart Nov 21, 2023
@@ -12,7 +12,10 @@ export const normalizeProduct = (product: SyliusProduct): Product => ({
title: product.name,
description: product.shortDescription
},
variants: product.variants.map((variant) => normalizeProductVariant(variant)),
// dont need varaints when serializing fort cart
Copy link
Collaborator

Choose a reason for hiding this comment

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

typos (on peut laisser si on s'en fout mais je remonte au cas où)

variants not needed for cart

variants: product.variants.map((variant) => normalizeProductVariant(variant)),
// dont need varaints when serializing fort cart
variants: product.variants
? product.variants.map((variant) => normalizeProductVariant(variant))
Copy link
Collaborator

Choose a reason for hiding this comment

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

product.variants.map(normalizeProductVariant) ?

syliusRequest(REST_METHODS.PUT, `/orders/${cartId}/items`, payload[0]);
return {};
export const addToCart = async (cartId: string | undefined, payload: AddToCartPayload[]) => {
await syliusRequest(REST_METHODS.POST, `/orders/${cartId}/items`, {
Copy link
Collaborator

Choose a reason for hiding this comment

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

là on transforme en post pour coller à une maj sylius ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

On transforme parce que j'avais mis un truc au hasard au début du projet 👀

@DuvCharles DuvCharles merged commit 959c58d into sylext-v2 Nov 24, 2023
1 check passed
@DuvCharles DuvCharles deleted the feat/add-to-cart branch November 24, 2023 09:25
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