feat: update hide-action logic in request list
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 8s
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 8s
This commit is contained in:
parent
a89de83fe9
commit
844cf176df
1 changed files with 1 additions and 14 deletions
|
|
@ -100,19 +100,6 @@ function triggerCancel(id: string) {
|
|||
});
|
||||
}
|
||||
|
||||
const hideAction = computed(() => {
|
||||
const role = getRole();
|
||||
const allowedRoles = [
|
||||
'head_of_admin',
|
||||
'head_of_sale',
|
||||
'admin',
|
||||
'sale',
|
||||
'system',
|
||||
];
|
||||
|
||||
return !role || !role.some((r) => allowedRoles.includes(r));
|
||||
});
|
||||
|
||||
function triggerView(opts: { requestData: RequestData }) {
|
||||
const url = new URL(
|
||||
`/request-list/${opts.requestData.id}`,
|
||||
|
|
@ -478,7 +465,7 @@ watch(
|
|||
:rows="data"
|
||||
:grid="pageState.gridView"
|
||||
:visible-columns="pageState.fieldSelected"
|
||||
:hide-action
|
||||
:hide-action="!canAccess('related', 'edit')"
|
||||
@view="(data) => triggerView({ requestData: data })"
|
||||
@delete="(data) => triggerCancel(data.id)"
|
||||
@reject-cancel="
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue