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:
c0mrade
2026-05-28 16:43:22 +03:00
parent 1b82280853
commit 574da67ca0

View File

@@ -131,7 +131,7 @@ export const subscriptionApi = {
}> => {
const response = await apiClient.put(
'/cabinet/subscription/traffic',
...bodyWithSubId({ gb }, subscriptionId),
...bodyWithSubId({ gb, yandex_cid: getYandexCid() || undefined }, subscriptionId),
);
return response.data;
},
@@ -357,7 +357,9 @@ export const subscriptionApi = {
},
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;
},
@@ -471,7 +473,7 @@ export const subscriptionApi = {
}> => {
const response = await apiClient.post(
'/cabinet/subscription/countries',
...bodyWithSubId({ countries }, subscriptionId),
...bodyWithSubId({ countries, yandex_cid: getYandexCid() || undefined }, subscriptionId),
);
return response.data;
},
@@ -571,7 +573,10 @@ export const subscriptionApi = {
}> => {
const response = await apiClient.post(
'/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;
},