diff --git a/src/app/functions/generate-referral.ts b/src/app/functions/generate-referral.ts index 83017b4..dcf75ab 100644 --- a/src/app/functions/generate-referral.ts +++ b/src/app/functions/generate-referral.ts @@ -30,7 +30,7 @@ export async function generateReferral({ } const token = randomBytes(16).toString('hex') - const url = `${process.env.BASE_URL}/referral?token=${token}&eventId=${eventId}` + const url = `${process.env.BASE_URL}/referral?token=${token}` const [subscription] = await db .select() diff --git a/src/http/routes/increment-referral-click-count.ts b/src/http/routes/increment-referral-click-count.ts index e74ee28..b12d435 100644 --- a/src/http/routes/increment-referral-click-count.ts +++ b/src/http/routes/increment-referral-click-count.ts @@ -33,7 +33,7 @@ const responseSchema = { export async function incrementReferralClickCountRoute(app: FastifyInstance) { app.withTypeProvider().route({ method: 'GET', - url: '/increment-referral-click-count', + url: '/referral', schema: { description: 'Increment referral click count', tags: ['Referral'], @@ -55,7 +55,9 @@ export async function incrementReferralClickCountRoute(app: FastifyInstance) { } } - return reply.status(200).send({ referral: result.right.referral }) + return reply + .status(302) + .redirect('https://www.youtube.com/watch?v=dQw4w9WgXcQ') }, }) }