mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-12-24 19:11:44 +01:00
26 lines
430 B
JavaScript
26 lines
430 B
JavaScript
|
|
||
|
export const state = () => ({
|
||
|
users: []
|
||
|
})
|
||
|
|
||
|
export const getters = {
|
||
|
|
||
|
}
|
||
|
|
||
|
export const actions = {
|
||
|
|
||
|
}
|
||
|
|
||
|
export const mutations = {
|
||
|
updateUser(state, user) {
|
||
|
var index = state.users.findIndex(u => u.id === user.id)
|
||
|
if (index >= 0) {
|
||
|
state.users.splice(index, 1, user)
|
||
|
} else {
|
||
|
state.users.push(user)
|
||
|
}
|
||
|
},
|
||
|
removeUser(state, user) {
|
||
|
state.users = state.users.filter(u => u.id !== user.id)
|
||
|
}
|
||
|
}
|