Merge pull request 'refactor: migrate `fetchUser` API call from PHP to Salix' (!111) from ldragan/hedera-web:taro/migrate-fetchUser into beta
gitea/hedera-web/pipeline/head This commit looks good Details

Reviewed-on: #111
Reviewed-by: Javier Segarra <jsegarra@verdnatura.es>
This commit is contained in:
Javier Segarra 2025-03-13 08:08:35 +00:00
commit 20293bd028
1 changed files with 4 additions and 5 deletions

View File

@ -248,11 +248,10 @@ export const useUserStore = defineStore('user', () => {
const fetchUser = async (userType = 'user') => {
try {
const userData = await jApi.getObject(
'SELECT id, nickname, name, lang FROM account.myUser'
);
if (userType === 'user') mainUser.value = userData;
else supplantedUser.value = userData;
const userData = await api.get('VnUsers/getCurrentUserData');
if (userType === 'user') mainUser.value = userData.data;
else supplantedUser.value = userData.data;
} catch (error) {
console.error('Error fetching user: ', error);
}