don't do separate users store just for admin stuff
This commit is contained in:
parent
7d3f46c529
commit
5ecfbee434
1 changed files with 0 additions and 26 deletions
|
|
@ -1,26 +0,0 @@
|
|||
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
|
||||
},
|
||||
},
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue