Tg with Notifications, bags fixxed

This commit is contained in:
2025-09-04 13:39:53 +03:00
parent f77d19975e
commit 51995c3695
13 changed files with 1775 additions and 34 deletions

View File

@@ -33,4 +33,44 @@ export async function registerStep1(data) {
});
return r.json();
}
export const getUsersStatus = async (token) => {
try {
const response = await fetch('/api/users/status', {
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
}
});
if (!response.ok) {
throw new Error('Failed to fetch users status');
}
return await response.json();
} catch (error) {
console.error('Error fetching users status:', error);
throw error;
}
};
export const loadUserInfo = async (userId, token) => {
try {
const response = await fetch(`/api/users/${userId}`, {
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
}
});
if (!response.ok) {
throw new Error('Failed to fetch user info');
}
return await response.json();
} catch (error) {
console.error('Error fetching user info:', error);
throw error;
}
};