- sistemato anche il users/profile ed aggiunto /users/activities

This commit is contained in:
Surya Paolo
2024-03-21 22:58:52 +01:00
parent 831ffcc8bf
commit 44ee68f8c6
3 changed files with 24 additions and 5 deletions

View File

@@ -98,8 +98,8 @@ export default defineComponent({
// Carica il profilo di quest'utente // Carica il profilo di quest'utente
if (username.value) { if (username.value) {
await userStore.loadUserProfile({ username: username.value, idnotif: idnotif.value }).then((ris) => { await userStore.loadUserActivities({ username: username.value, idnotif: idnotif.value }).then((ris) => {
console.log('loadUserProfile = ', ris) // console.log('loadUserProfile = ', ris)
myuser.value = ris myuser.value = ris
if (myuser.value) { if (myuser.value) {
// filtro_eventi.value = [{ userId: myuser.value._id }, { dateTimeStart: { $gte: today } }] // filtro_eventi.value = [{ userId: myuser.value._id }, { dateTimeStart: { $gte: today } }]

View File

@@ -30,7 +30,7 @@
</div> </div>
<div class="q-gutter-sm q-pa-sm q-pb-md"> <div class="q-gutter-sm q-pa-sm q-pb-md">
<div <div
v-if="myuser && myuser.date_reg" v-if="myuser && myuser.lang"
class="fit column no-wrap justify-evenly items-center content-start" class="fit column no-wrap justify-evenly items-center content-start"
> >
<div class=""> <div class="">
@@ -116,7 +116,7 @@
:name="card.table" :name="card.table"
> >
<q-card class="q-my-md"> <q-card class="q-my-md">
<div v-if="card.table === 'mygroups' && tools.isUserOk()"> <div v-if="(card.table === 'mygroups') && tools.isUserOk()">
<div class="row text-h6 text-bold">Gruppi:</div> <div class="row text-h6 text-bold">Gruppi:</div>
<q-list> <q-list>
<span <span
@@ -153,7 +153,7 @@
</span> </span>
</q-list> </q-list>
</div> </div>
<div v-else> <div v-else-if="card.table !== 'mygroups' || myuser.email">
<CSkill <CSkill
:table="card.table" :table="card.table"
:filtercustom="card.table === 'mybachecas' ? filtro_eventi: filtroutente" :filtercustom="card.table === 'mybachecas' ? filtro_eventi: filtroutente"

View File

@@ -1529,6 +1529,25 @@ export const useUserStore = defineStore('UserStore', {
}, },
async loadUserActivities({ username, idnotif }: { username: string, idnotif?: string }) {
const data = {
username,
idnotif
}
return await Api.SendReq('/users/activities', 'POST', data)
.then((ris) => {
if (this.my.username === ris.data.user.username) {
// this.updateDataFr(ris.data.friends)
}
return ris.data.user
}).catch((error) => {
return {}
})
},
async setUserNotifs(notifs: IUserNotifType[]) { async setUserNotifs(notifs: IUserNotifType[]) {
const data = { const data = {
notifs notifs