mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-30 02:23:47 +00:00
feat(yandex-conv): forward CID through remaining paid API methods
Pair with the bot's #558449 follow-up. Pass getYandexCid() through the four cabinet API methods that previously omitted it: - switchTraffic (PUT /traffic) - activateTrial (POST /trial — body added, was previously empty POST) - updateCountries (POST /countries) - switchTariff (POST /tariff/switch) Without these the backend now-typed yandex_cid field would silently stay None for these paid flows even when the user had a CID cached.
This commit is contained in:
@@ -131,7 +131,7 @@ export const subscriptionApi = {
|
|||||||
}> => {
|
}> => {
|
||||||
const response = await apiClient.put(
|
const response = await apiClient.put(
|
||||||
'/cabinet/subscription/traffic',
|
'/cabinet/subscription/traffic',
|
||||||
...bodyWithSubId({ gb }, subscriptionId),
|
...bodyWithSubId({ gb, yandex_cid: getYandexCid() || undefined }, subscriptionId),
|
||||||
);
|
);
|
||||||
return response.data;
|
return response.data;
|
||||||
},
|
},
|
||||||
@@ -357,7 +357,9 @@ export const subscriptionApi = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
activateTrial: async (): Promise<Subscription> => {
|
activateTrial: async (): Promise<Subscription> => {
|
||||||
const response = await apiClient.post<Subscription>('/cabinet/subscription/trial');
|
const response = await apiClient.post<Subscription>('/cabinet/subscription/trial', {
|
||||||
|
yandex_cid: getYandexCid() || undefined,
|
||||||
|
});
|
||||||
return response.data;
|
return response.data;
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -471,7 +473,7 @@ export const subscriptionApi = {
|
|||||||
}> => {
|
}> => {
|
||||||
const response = await apiClient.post(
|
const response = await apiClient.post(
|
||||||
'/cabinet/subscription/countries',
|
'/cabinet/subscription/countries',
|
||||||
...bodyWithSubId({ countries }, subscriptionId),
|
...bodyWithSubId({ countries, yandex_cid: getYandexCid() || undefined }, subscriptionId),
|
||||||
);
|
);
|
||||||
return response.data;
|
return response.data;
|
||||||
},
|
},
|
||||||
@@ -571,7 +573,10 @@ export const subscriptionApi = {
|
|||||||
}> => {
|
}> => {
|
||||||
const response = await apiClient.post(
|
const response = await apiClient.post(
|
||||||
'/cabinet/subscription/tariff/switch',
|
'/cabinet/subscription/tariff/switch',
|
||||||
...bodyWithSubId({ tariff_id: tariffId, period_days: 30 }, subscriptionId),
|
...bodyWithSubId(
|
||||||
|
{ tariff_id: tariffId, period_days: 30, yandex_cid: getYandexCid() || undefined },
|
||||||
|
subscriptionId,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
return response.data;
|
return response.data;
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user