load agents directly in AgentList

Fetch agents through the API in AgentList instead of the shared users store, so the list does not depend on store state populated elsewhere.
This commit is contained in:
Abhinav Raut
2026-07-12 04:48:39 +05:30
parent c8884ec005
commit 623fa2c478
@@ -40,13 +40,11 @@ import { handleHTTPError } from '@shared-ui/utils/http.js'
import LoadingOverlay from '@/components/layout/LoadingOverlay.vue'
import { useEmitter } from '@/composables/useEmitter'
import { EMITTER_EVENTS } from '@/constants/emitterEvents.js'
import { useUsersStore } from '@/stores/users'
import { useI18n } from 'vue-i18n'
import Importer from '@/components/importer/Importer.vue'
import api from '@/api'
const isLoading = ref(false)
const usersStore = useUsersStore()
const { t } = useI18n()
const data = ref([])
const emitter = useEmitter()
@@ -67,8 +65,8 @@ onUnmounted(() => {
const getData = async () => {
try {
isLoading.value = true
await usersStore.fetchUsers(true)
data.value = usersStore.users
const response = await api.getUsers()
data.value = response?.data?.data || []
} catch (error) {
emitter.emit(EMITTER_EVENTS.SHOW_TOAST, {
variant: 'destructive',