mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-30 10:27:49 +00:00
feat: send campaign_slug during standalone email registration
Frontend now reads campaign slug from localStorage and includes it in the registration API call, ensuring campaign attribution works even if email verification happens in a different browser.
This commit is contained in:
@@ -97,6 +97,7 @@ export const authApi = {
|
|||||||
first_name?: string;
|
first_name?: string;
|
||||||
language?: string;
|
language?: string;
|
||||||
referral_code?: string;
|
referral_code?: string;
|
||||||
|
campaign_slug?: string;
|
||||||
}): Promise<RegisterResponse> => {
|
}): Promise<RegisterResponse> => {
|
||||||
const response = await apiClient.post<RegisterResponse>(
|
const response = await apiClient.post<RegisterResponse>(
|
||||||
'/cabinet/auth/email/register/standalone',
|
'/cabinet/auth/email/register/standalone',
|
||||||
|
|||||||
@@ -359,12 +359,14 @@ export const useAuthStore = create<AuthState>()(
|
|||||||
|
|
||||||
registerWithEmail: async (email, password, firstName, referralCode) => {
|
registerWithEmail: async (email, password, firstName, referralCode) => {
|
||||||
const code = referralCode || getPendingReferralCode() || undefined;
|
const code = referralCode || getPendingReferralCode() || undefined;
|
||||||
|
const campaignSlug = getPendingCampaignSlug() || undefined;
|
||||||
const response = await authApi.registerEmailStandalone({
|
const response = await authApi.registerEmailStandalone({
|
||||||
email,
|
email,
|
||||||
password,
|
password,
|
||||||
first_name: firstName,
|
first_name: firstName,
|
||||||
language: navigator.language.split('-')[0] || 'ru',
|
language: navigator.language.split('-')[0] || 'ru',
|
||||||
referral_code: code,
|
referral_code: code,
|
||||||
|
campaign_slug: campaignSlug,
|
||||||
});
|
});
|
||||||
consumeReferralCode();
|
consumeReferralCode();
|
||||||
return response;
|
return response;
|
||||||
|
|||||||
Reference in New Issue
Block a user