-
Notifications
You must be signed in to change notification settings - Fork 3
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
Feat/add to cart #21
Conversation
6b369db
to
ed42631
Compare
4cf720b
to
45c1b67
Compare
45c1b67
to
39f899d
Compare
@@ -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 |
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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`, { |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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 👀
08b221a
to
da35cd2
Compare
No description provided.