[balance] show receiver or sender in overview

This commit is contained in:
Tim Gröger 2021-04-18 00:23:14 +02:00
parent ca9e4bdbcb
commit 5e8f4bc86a
1 changed files with 7 additions and 2 deletions

View File

@ -127,8 +127,9 @@ export default defineComponent({
else {
if (row.receiver_id == null) return 'Angeschrieben';
else {
if (row.receiver_id === mainStore.currentUser.userid) return 'Bekommen von X';
else return 'Gesendet an X';
if (row.receiver_id === mainStore.currentUser.userid)
return `Bekommen von ${<string>getName(row.sender_id)}`;
else return `Gesendet an ${<string>getName(row.receiver_id)}`;
}
}
},
@ -151,6 +152,10 @@ export default defineComponent({
},
];
function getName(userid: string) {
return userStore.users.find((a) => a.userid === userid)?.display_name;
}
return { data, pagination, onRequest, loading, balance, columns, showCancelled };
},
});