refactor: migrate `fetchUser` API call from PHP to Salix
gitea/hedera-web/pipeline/pr-beta This commit looks good
Details
gitea/hedera-web/pipeline/pr-beta This commit looks good
Details
This commit is contained in:
parent
42a7503f37
commit
29c42d7f34
|
@ -248,11 +248,13 @@ export const useUserStore = defineStore('user', () => {
|
||||||
|
|
||||||
const fetchUser = async (userType = 'user') => {
|
const fetchUser = async (userType = 'user') => {
|
||||||
try {
|
try {
|
||||||
const userData = await jApi.getObject(
|
const _token = getToken();
|
||||||
'SELECT id, nickname, name, lang FROM account.myUser'
|
const userData = await api.get('VnUsers/getCurrentUserData', {
|
||||||
);
|
headers: { Authorization: _token }
|
||||||
if (userType === 'user') mainUser.value = userData;
|
});
|
||||||
else supplantedUser.value = userData;
|
|
||||||
|
if (userType === 'user') mainUser.value = userData.data;
|
||||||
|
else supplantedUser.value = userData.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error fetching user: ', error);
|
console.error('Error fetching user: ', error);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue