Fixed: le reactions devono stare in una tabella a parte (reactions).

- cambiata la gestione dei seen, fav, book, attend
This commit is contained in:
Surya Paolo
2023-09-27 18:39:05 +02:00
parent f88b753f26
commit 2b359d5260
18 changed files with 4166 additions and 131 deletions

View File

@@ -24,7 +24,7 @@ import { useI18n } from '@/boot/i18n'
import { toolsext } from '@store/Modules/toolsext'
import { useQuasar } from 'quasar'
import { costanti } from '@costanti'
import { IBookmark, ICircuit, IFavorite, IMyCircuit, IMyGroup, IUserFields } from 'model'
import { IBookmark, IReaction, ICircuit, IFavorite, IMyCircuit, IMyGroup, IUserFields } from 'model'
import { shared_consts } from '@/common/shared_vuejs'
import { static_data } from '@/db/static_data'
import { fieldsTable } from '@store/Modules/fieldsTable'
@@ -183,19 +183,19 @@ export default defineComponent({
function filtrofavorite(table: string) {
const tab = tools.getNumTabByTable(table)
if (myuser.value && myuser.value.profile.favorite) {
let arrfav = myuser.value.profile.favorite.filter((rec: IBookmark) => rec.tab === tab)
if (myuser.value && myuser.value.profile.reaction) {
let arrfav = myuser.value.profile.reaction.filter((rec: IReaction) => rec.tab === tab && (rec.fav! === true))
if (arrfav)
return myuser.value.profile.favorite ? [{ _id: { $in: arrfav.map((rec: any) => rec.id) } }] : []
return myuser.value.profile.reaction ? [{ _id: { $in: arrfav.map((rec: any) => rec.id) } }] : []
}
return []
}
function filtrobookmark(table: string) {
const tab = tools.getNumTabByTable(table)
if (myuser.value && myuser.value.profile.bookmark) {
let arrfav = myuser.value.profile.bookmark.filter((rec: IBookmark) => rec.tab === tab)
if (myuser.value && myuser.value.profile.reaction) {
let arrfav = myuser.value.profile.reaction.filter((rec: IReaction) => rec.tab === tab && rec.book === true);
if (arrfav)
return myuser.value.profile.bookmark ? [{ _id: { $in: arrfav.map((rec: any) => rec.id) } }] : []
return myuser.value.profile.reaction ? [{ _id: { $in: arrfav.map((rec: any) => rec.id) } }] : []
}
return []
}