- aggiunto anche nei beni, servizi e ospitalità la possibilità di aggiungerli come "Gruppo"

This commit is contained in:
Surya Paolo
2025-01-14 18:34:52 +01:00
parent 45be5038b9
commit 39784aeb0e
9 changed files with 110 additions and 36 deletions

View File

@@ -13,6 +13,8 @@ const shared_consts = require('../tools/shared_nodejs');
const { ObjectId } = require('mongodb');
const tableModel = shared_consts.TABLES_ATTIVITAS;
// Resolving error Unknown modifier: $pushAll
mongoose.plugin(schema => {
schema.options.usePushEach = true;
@@ -182,7 +184,7 @@ AttivitaSchema.statics.executeQueryTable = function (idapp, params, user) {
lk_FF: '_id',
lk_as: 'user',
af_objId_tab: 'myId',
lk_proj: this.getProject(),
lk_proj: shared_consts.getProjectForAll({}, tableModel),
},
};
@@ -236,7 +238,7 @@ AttivitaSchema.statics.getMyRecById = function (idapp, idSkill) {
},
},
{
$project: this.getProject(),
$project: shared_consts.getProjectForAll({}, tableModel),
},
{
'$lookup': {
@@ -262,7 +264,7 @@ AttivitaSchema.statics.getMyRecById = function (idapp, idSkill) {
},
},
{
$project: this.getProject(),
$project: shared_consts.getProjectForAll({}, tableModel),
},
{
'$lookup': {
@@ -288,7 +290,7 @@ AttivitaSchema.statics.getMyRecById = function (idapp, idSkill) {
},
},
{
$project: this.getProject(),
$project: shared_consts.getProjectForAll({}, tableModel),
},
{
'$replaceRoot': {
@@ -306,7 +308,7 @@ AttivitaSchema.statics.getMyRecById = function (idapp, idSkill) {
},
},
{
$project: this.getProject(),
$project: shared_consts.getProjectForAll({}, tableModel),
},
{
'$lookup': {
@@ -339,7 +341,7 @@ AttivitaSchema.statics.getMyRecById = function (idapp, idSkill) {
query = [...query, ...objadd.query];
const toadd = {
$project: this.getProject(objadd.proj),
$project: shared_consts.getProjectForAll(objadd.proj, tableModel),
};
query = [...query, { ...toadd }];