From b1ec0b6a67a1c3fece394d8dd82110c2edeb53bf Mon Sep 17 00:00:00 2001 From: Surya Paolo Date: Thu, 15 Dec 2022 21:57:44 +0100 Subject: [PATCH] ++ su "Friends" la ricerca per username Telegram e nome e cognome --- src/components/MyHeader/MyHeader.vue | 1 + src/views/user/mycircuit/mycircuit.ts | 60 +++++++++++++++----------- src/views/user/myfriends/myfriends.ts | 1 + src/views/user/mygroup/mygroup.ts | 4 +- src/views/user/myprofile/myprofile.vue | 48 ++++++++++++--------- 5 files changed, 66 insertions(+), 48 deletions(-) diff --git a/src/components/MyHeader/MyHeader.vue b/src/components/MyHeader/MyHeader.vue index 9ad993c0..5859d3e8 100755 --- a/src/components/MyHeader/MyHeader.vue +++ b/src/components/MyHeader/MyHeader.vue @@ -304,6 +304,7 @@
{{ Username() }} - {{ myName() }} +  {{ mySurname() }}
{ + await userStore.loadCircuit(path.value, idnotif.value).then(({ data, status }: { data: any, status: number }) => { console.log('data', data) if (data) { notifStore.setAsRead(idnotif.value) @@ -131,9 +131,10 @@ export default defineComponent({ */ { - $match: {idapp: process.env.APP_ID, + $match: { + idapp: process.env.APP_ID, 'profile.mycircuits': { - $elemMatch: {circuitname: {$eq: circuit.value.name}}, + $elemMatch: { circuitname: { $eq: circuit.value.name } }, }, }, }, @@ -142,29 +143,34 @@ export default defineComponent({ $lookup: { from: 'circuits', as: 'circuit', - let: {circuitname: circuit.value.name, idapp: '$idapp'}, + let: { circuitname: circuit.value.name, idapp: '$idapp' }, pipeline: [ { $match: + { + $expr: { - $expr: - { - $and: - [ - {$eq: ['$name', '$$circuitname']}, - {$eq: ['$idapp', '$$idapp']}, + $and: + [ + { $eq: ['$name', '$$circuitname'] }, + { $eq: ['$idapp', '$$idapp'] }, - ], - }, + ], }, + }, }, ], }, }, - { $unwind: '$circuit'}, + { $unwind: '$circuit' }, { - $project: { username: 1, profile: 1, idapp: 1, 'circuit.name': 1, 'circuit._id': 1 } + $project: { + username: 1, + name: 1, + surname: 1, + profile: 1, idapp: 1, 'circuit.name': 1, 'circuit._id': 1 + } }, @@ -172,26 +178,26 @@ export default defineComponent({ $lookup: { from: 'accounts', as: 'account', - let: {username: '$username', idapp: '$idapp', circuitId: '$circuit._id'}, + let: { username: '$username', idapp: '$idapp', circuitId: '$circuit._id' }, pipeline: [ { $match: + { + $expr: { - $expr: - { - $and: - [ - {$eq: ['$$username', '$username']}, - {$eq: ['$$idapp', '$idapp']}, - {$eq: ['$$circuitId', '$circuitId']}, - ], - }, + $and: + [ + { $eq: ['$$username', '$username'] }, + { $eq: ['$$idapp', '$idapp'] }, + { $eq: ['$$circuitId', '$circuitId'] }, + ], }, + }, }, ], }, }, - { $unwind: '$account'}, + { $unwind: '$account' }, ] } arrfilterand.value = [] @@ -236,7 +242,9 @@ export default defineComponent({ lk_as, af_objId_tab, lk_proj: { - 'username': 1, + username: 1, + name: 1, + surname: 1, 'profile.img': 1, 'profile.mycircuits': 1, 'profile.qualifica': 1, diff --git a/src/views/user/myfriends/myfriends.ts b/src/views/user/myfriends/myfriends.ts index 5bd8c38e..ccdee44a 100755 --- a/src/views/user/myfriends/myfriends.ts +++ b/src/views/user/myfriends/myfriends.ts @@ -113,6 +113,7 @@ export default defineComponent({ lk_proj: { username: 1, name: 1, + surname: 1, 'profile.img': 1, 'profile.born_city_id': 1, 'profile.qualifica': 1, diff --git a/src/views/user/mygroup/mygroup.ts b/src/views/user/mygroup/mygroup.ts index e06cab7c..572bd89f 100755 --- a/src/views/user/mygroup/mygroup.ts +++ b/src/views/user/mygroup/mygroup.ts @@ -159,7 +159,9 @@ export default defineComponent({ lk_as, af_objId_tab, lk_proj: { - 'username': 1, + username: 1, + name: 1, + surname: 1, 'profile.img': 1, 'profile.mygroups': 1, 'profile.qualifica': 1, diff --git a/src/views/user/myprofile/myprofile.vue b/src/views/user/myprofile/myprofile.vue index cbdf677a..30471973 100755 --- a/src/views/user/myprofile/myprofile.vue +++ b/src/views/user/myprofile/myprofile.vue @@ -1,9 +1,9 @@