supplant user migration
gitea/hedera-web/pipeline/pr-beta This commit looks good Details

This commit is contained in:
William Buezas 2025-04-30 11:44:32 +02:00
parent a8277a2473
commit ca34bb1ad2
1 changed files with 6 additions and 3 deletions

View File

@ -1,6 +1,6 @@
import { defineStore } from 'pinia'; import { defineStore } from 'pinia';
import { ref, computed, watch } from 'vue'; import { ref, computed, watch } from 'vue';
import { api, jApi } from '@/boot/axios'; import { api } from '@/boot/axios';
import useNotify from '@/composables/useNotify.js'; import useNotify from '@/composables/useNotify.js';
import { useAppStore } from '@/stores/app.js'; import { useAppStore } from '@/stores/app.js';
@ -263,8 +263,11 @@ export const useUserStore = defineStore('user', () => {
}; };
const supplantUser = async supplantUser => { const supplantUser = async supplantUser => {
const json = await jApi.send('client/supplant', { supplantUser }); const { data } = await api.post('VnUsers/supplantUser', {
token.value = json; supplantUser
});
if (!data || !data.id) return;
token.value = data.id;
sessionStorage.setItem('supplantUser', supplantUser); sessionStorage.setItem('supplantUser', supplantUser);
await fetchUser('supplantedUser'); await fetchUser('supplantedUser');
}; };