Исправила отображение контактов на записи

This commit is contained in:
Daria Golova
2023-08-25 14:26:53 +03:00
parent d1c5dc5683
commit 15e31ebcd7
10 changed files with 164 additions and 299 deletions

View File

@@ -64,15 +64,27 @@ export default {
},
computed: {
contacts() {
let contactList = this.record?.person?.contacts
?.filter(
(elem) => elem.category === "PHONE" || elem.category === "EMAIL"
)
?.map((elem) => ({
kind: elem.category,
icon: networks.find((item) => item.id === elem.category)?.icon,
value: elem.value,
}));
let contactList = [];
this.record?.person?.contacts?.find((elem) => {
if (elem.category === "PHONE") {
contactList.push({
kind: elem?.category,
icon: networks?.find((item) => item.id === elem.category)?.icon,
value: elem?.value,
});
return true;
}
});
this.record?.person?.contacts?.find((elem) => {
if (elem.category === "EMAIL") {
contactList.push({
kind: elem?.category,
icon: networks?.find((item) => item.id === elem.category)?.icon,
value: elem?.value,
});
return true;
}
});
if (this.collapsedDisplayCondition) {
contactList.length = 1;
return contactList;