Update profile.js
This commit is contained in:
@@ -23,14 +23,14 @@ async function getProfileFromAnixart(profileId, token = '') {
|
|||||||
// Ошибку верификации игнорируем
|
// Ошибку верификации игнорируем
|
||||||
}
|
}
|
||||||
|
|
||||||
// Подгружаем кастомные роли по URL
|
// Подгружаем кастомные роли
|
||||||
try {
|
try {
|
||||||
const rolesResponse = await axios.get('https://anixart.seele.su/api/is_roles');
|
const rolesResponse = await axios.get('https://anixart.seele.su/api/is_roles');
|
||||||
const rolesList = rolesResponse.data;
|
const rolesList = rolesResponse.data;
|
||||||
|
|
||||||
const userRoles = rolesList.find(entry => entry.id === Number(profileId));
|
const userRoles = rolesList.find(entry => entry.id === Number(profileId));
|
||||||
if (userRoles && Array.isArray(userRoles.roles)) {
|
if (userRoles && Array.isArray(userRoles.role)) {
|
||||||
profileData.profile.roles = userRoles.roles;
|
profileData.profile.roles = userRoles.role;
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
// Ошибку загрузки ролей игнорируем
|
// Ошибку загрузки ролей игнорируем
|
||||||
|
|||||||
Reference in New Issue
Block a user