Refactor row action handling in FormPiyangoOnayDurum component. Replace EditOnay with adminRowAction and update rowActions to adminRowActions based on user role, enhancing access control and functionality.
This commit is contained in:
@ -2,14 +2,14 @@
|
||||
<list-table-content
|
||||
v-if="loaded"
|
||||
:tableHeader="tableHeader"
|
||||
:rowAction="EditOnay"
|
||||
:rowAction="adminRowAction"
|
||||
formTitle="Piyango Onay Durumları"
|
||||
listText="Kayıt"
|
||||
:apiList="'OnayDurumu/GetSonOnayDurumlariList/' + piyangoStore.selectedLottery"
|
||||
apiText="Piyango Onay Log Listesi"
|
||||
page="form"
|
||||
:refresh="piyangoOnayStore.refreshList"
|
||||
:rowActions="rowActions" />
|
||||
:rowActions="adminRowActions" />
|
||||
<panel-wrapper
|
||||
v-if="piyangoOnayStore.onayFormPanel"
|
||||
v-model="piyangoOnayStore.onayFormPanel"
|
||||
@ -45,6 +45,8 @@
|
||||
const dialogStore = useDialogStore()
|
||||
import { useDataStore } from '@/stores/dataStore'
|
||||
const dataStore = useDataStore()
|
||||
import { useUsersStore } from '@/stores/usersStore'
|
||||
const usersStore = useUsersStore()
|
||||
|
||||
const loaded = ref<boolean>(false)
|
||||
|
||||
@ -214,6 +216,14 @@
|
||||
}
|
||||
])
|
||||
|
||||
const adminRowAction = computed(() => {
|
||||
return usersStore.isPanelUser ? EditOnay : undefined
|
||||
})
|
||||
|
||||
const adminRowActions = computed(() => {
|
||||
return usersStore.isPanelUser ? rowActions.value : []
|
||||
})
|
||||
|
||||
onBeforeMount(async () => {
|
||||
loaded.value = true
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user