This commit is contained in:
2024-11-18 17:20:51 +01:00
parent a59d438dbb
commit a6731fcdfc
9 changed files with 60 additions and 14 deletions
@@ -3,6 +3,7 @@ import { type Ref, defineComponent, inject, onMounted, ref } from 'vue';
import TransactionService from './transaction.service';
import { type ITransaction } from '@/shared/model/transaction.model';
import { useAlertService } from '@/shared/alert/alert.service';
import type AccountService from '@/account/account.service';
export default defineComponent({
compatConfig: { MODE: 3 },
@@ -19,6 +20,8 @@ export default defineComponent({
const alertService = inject('alertService', () => useAlertService(), true);
const transactions: Ref<ITransaction[]> = ref([]);
const hasAnyAuthorityValues: Ref<any> = ref({});
const accountService = inject<AccountService>('accountService');
const isFetching = ref(false);
@@ -75,10 +78,22 @@ export default defineComponent({
retrieveTransactions,
clear,
removeId,
accountService,
hasAnyAuthorityValues,
removeEntity,
prepareRemove,
closeDialog,
removeTransaction,
};
},
methods: {
hasAnyAuthority(authorities: any): boolean {
this.accountService.hasAnyAuthorityAndCheckAuth(authorities).then(value => {
if (this.hasAnyAuthorityValues[authorities] !== value) {
this.hasAnyAuthorityValues = { ...this.hasAnyAuthorityValues, [authorities]: value };
}
});
return this.hasAnyAuthorityValues[authorities] ?? false;
},
},
});