From 9d239f78636d3ac45cd68446a2839c0b6b0c40cc Mon Sep 17 00:00:00 2001 From: Camila Sosa Morales Date: Fri, 24 Jan 2025 17:53:30 -0300 Subject: [PATCH] chore: send referral id in the api (#467) ## Why? Clear and short explanation here. ## How? - Done A (replace with a breakdown of the steps) - Done B - Done C ## Tickets? - [Ticket 1](the-ticket-url-here) - [Ticket 2](the-ticket-url-here) - [Ticket 3](the-ticket-url-here) ## Contribution checklist? - [ ] The commit messages are detailed - [ ] The `build` command runs locally - [ ] Assets or static content are linked and stored in the project - [ ] Document filename is named after the slug - [ ] You've reviewed spelling using a grammar checker - [ ] For documentation, guides or references, you've tested the commands and steps - [ ] You've done enough research before writing ## Security checklist? - [ ] Sensitive data has been identified and is being protected properly - [ ] Injection has been prevented (parameterized queries, no eval or system calls) - [ ] The Components are escaping output (to prevent XSS) ## References? Optionally, provide references such as links ## Preview? Optionally, provide the preview url here --- src/components/Eliza/api/index.ts | 4 ++++ src/components/Eliza/components/SubscriptionModal.tsx | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/Eliza/api/index.ts b/src/components/Eliza/api/index.ts index 9d6fafdbe..c825c1df9 100644 --- a/src/components/Eliza/api/index.ts +++ b/src/components/Eliza/api/index.ts @@ -242,6 +242,7 @@ export const createSubscription = async ( projectId?: string, productId?: string, token?: string, + referralId?: string, ): Promise<{ ok: boolean; data?: { @@ -269,6 +270,9 @@ export const createSubscription = async ( id: productId, quantity: 1, }, + metadata: { + referralId, + }, }), }, ); diff --git a/src/components/Eliza/components/SubscriptionModal.tsx b/src/components/Eliza/components/SubscriptionModal.tsx index 7b6f7a538..1d6c3b537 100644 --- a/src/components/Eliza/components/SubscriptionModal.tsx +++ b/src/components/Eliza/components/SubscriptionModal.tsx @@ -40,8 +40,6 @@ export const SubscriptionModal: React.FC = ({ setIsLoading(true); - // const referralId = window.promotekit_referral; - const subscriptionCreationResponse = await createSubscription( activeProjectId, productId,