api update

This commit is contained in:
2026-04-25 18:21:24 +07:00
parent 3f635a81dc
commit 03d3a072d3
5 changed files with 12 additions and 9 deletions
+4 -3
View File
@@ -199,9 +199,9 @@ export default function Profile() {
const handleTrial = async () => {
try {
await activateTrial();
window.location.reload();
const newData = await fetchProfile();
setData(newData);
} catch (e: any) {
// 🔥 ИСПРАВЛЕНО: Вывод реальной ошибки с бэкенда
alert(`[ERROR] ${e.message}`);
}
};
@@ -209,7 +209,8 @@ export default function Profile() {
const handleBuy = async (planName: string) => {
try {
await buySubscription(planName);
window.location.reload();
const newData = await fetchProfile();
setData(newData);
} catch (e: any) {
alert(`[ERROR] ${e.message}`);
}