Skip to content

Commit

Permalink
fix(admin): fix data reference error, fix #289
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Jan 13, 2024
1 parent ac6d710 commit 1401bb9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions plugins/admin/client/group.vue
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ const activeTrack = computed<string>({
})
const permissions = computed(() => {
return data[active.value.type][active.value.id].permissions
return data.value[active.value.type][active.value.id].permissions
})
const renameItem = debounce(1000, (type: 'group' | 'track', id: number, name: string) => {
Expand All @@ -179,10 +179,10 @@ const renameItem = debounce(1000, (type: 'group' | 'track', id: number, name: st
const renameInput = computed<string>({
get() {
return data[active.value.type][active.value.id].name
return data.value[active.value.type][active.value.id].name
},
set(value) {
data[active.value.type][active.value.id].name = value
data.value[active.value.type][active.value.id].name = value
renameItem(active.value.type, +active.value.id, value)
},
})
Expand All @@ -200,14 +200,14 @@ async function deleteItem() {
}
async function addPermission() {
const { permissions } = data[active.value.type][active.value.id]
const { permissions } = data.value[active.value.type][active.value.id]
permissions.push(permission.value)
permission.value = null
await send(`admin/update-${active.value.type}`, +active.value.id, permissions)
}
async function removePermission(index: number) {
const { permissions } = data[active.value.type][active.value.id]
const { permissions } = data.value[active.value.type][active.value.id]
permissions.splice(index, 1)
await send(`admin/update-${active.value.type}`, +active.value.id, permissions)
}
Expand Down

0 comments on commit 1401bb9

Please sign in to comment.