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

Add purchase callback #34

Merged
merged 3 commits into from
Jun 22, 2024

Conversation

hvergara
Copy link
Contributor

Adds a simple purchase callback, to manage the signal back from commerce (Stripe/MercadoPago) and trigger CheckPurchaseOrderStatus mutation

Copy link

socket-security bot commented Jun 22, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/[email protected] environment +2 2.15 MB popmotion

🚮 Removed packages: npm/[email protected]

View full report↗︎

}

const { data, errors } =
await client.mutate<CheckPurchaseOrderStatusMutation>({
Copy link
Member

@fforres fforres Jun 22, 2024

Choose a reason for hiding this comment

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

Quizas podríamos usar el useCheckPurchaseOrderStatusMutation(), y llamar la función dentro de un useEffect.

Como porque si este componente se re-renderiza onda... X veces, se manda la mutación X veces también.

(O llamar client.mutate() dentro de un useEffect también funcionaría, pero es mas comun usar el useCheckPurchaseOrderStatusMutation)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

lo habia intentado asi al principio, pero entraba en conflicto con el SSR. Si lo transformo a un client component podría usar useEffect.

Copy link
Member

Choose a reason for hiding this comment

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

si, filo con SSR :D

<CardTitle>Oops!</CardTitle>
<CardContent>
<ol>
{errors.map((error, index) => (
Copy link
Member

Choose a reason for hiding this comment

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

nit: derepente esto va a exponer como errores onda internos o no? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sip, pero quiero dejarlo como placeholder y mejorarlo despues: #35

Copy link
Member

Choose a reason for hiding this comment

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

🙏🏼

fforres
fforres previously approved these changes Jun 22, 2024
@hvergara hvergara merged commit 2cb774b into JSConfCL:main Jun 22, 2024
3 checks passed
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