This commit is contained in:
Henry Jameson 2026-06-08 20:31:42 +03:00
commit 7d3f46c529
13 changed files with 137 additions and 828 deletions

26
src/stores/adminUsers.js Normal file
View file

@ -0,0 +1,26 @@
import { defineStore } from 'pinia'
export const useAdminUsersStore = defineStore('adminUsers', {
state: () => ({
users: new Map()
}),
getters: {
getUser(state) {
return (id) => state.users.get(id)
},
},
actions: {
async fetchAdminUsers(opts) {
const data = await window.vuex.state.api.backendInteractor.adminListUsers({
opts,
})
data.users.forEach((user) => {
window.vuex.dispatch('fetchUserIfMissing', user.id),
this.users.set(user.id, user)
})
return data
},
},
})