fixed user-device management
This commit is contained in:
@@ -12,12 +12,8 @@ import { Ellipsis } from 'lucide-vue-next'
|
||||
import type { Device, Users } from '@/lib/interfaces'
|
||||
// import { api } from '@/lib/api'
|
||||
|
||||
const props = defineProps<{
|
||||
row: Device
|
||||
allUsers?: Users[]
|
||||
onRowUpdated?: (row: Device, payload: { name: string; userIds: string[] }) => void
|
||||
onRowDeleted?: (row: Device) => void
|
||||
}>() // ← accept full row
|
||||
|
||||
const props = defineProps<{ row: Device; allUsers?: Users[] }>()
|
||||
|
||||
const isEditOpen = ref(false)
|
||||
const isDeleteOpen = ref(false)
|
||||
@@ -32,13 +28,11 @@ const emit = defineEmits<{
|
||||
function onDeleteConfirmed() {
|
||||
// await api.delete(`/devices/${encodeURIComponent(props.row.guid)}`)
|
||||
isDeleteOpen.value = false
|
||||
// emit('refresh')
|
||||
props.onRowDeleted?.(props.row)
|
||||
emit('deleted')
|
||||
}
|
||||
function onEditConfirm(_payload: { name: string; userIds: string[] }) {
|
||||
isEditOpen.value = false
|
||||
// emit('refresh')
|
||||
props.onRowUpdated?.(props.row, _payload)
|
||||
emit('updated', _payload)
|
||||
}
|
||||
|
||||
function onTaskConfirm() {
|
||||
|
||||
Reference in New Issue
Block a user