Balance Overview: Fixed issue if users are not loaded

This commit is contained in:
Ferdinand Thiessen 2021-01-29 23:29:20 +01:00
parent bda5602e9f
commit c9d8365def
1 changed files with 11 additions and 5 deletions

View File

@ -44,10 +44,12 @@ export default defineComponent({
onMounted(() => {
void store.dispatch('balance/getBalance');
void store.dispatch('user/getUsers').then(() =>
onRequest({
pagination: pagination.value,
filter: undefined
});
})
);
});
const showCancelled = ref(false);
@ -138,7 +140,11 @@ export default defineComponent({
name: 'author_id',
label: 'Benutzer',
field: 'author_id',
format: (val: string) => store.state.user.users.filter(x => x.userid == val)[0].display_name
format: (val: string) => {
const user = store.state.user.users.filter(x => x.userid == val);
if (user.length > 0) return user[0].display_name;
else return val;
}
}
];