Circuit go on...

This commit is contained in:
paoloar77
2022-08-30 17:00:48 +02:00
parent a2019c6ac9
commit f55d69b7fe
7 changed files with 275 additions and 16 deletions

View File

@@ -15,13 +15,14 @@ mongoose.plugin(schema => {
});
const CircuitSchema = new Schema({
idapp: {
type: String,
},
Num: {
type: Number,
unique: true,
},
idapp: {
type: String,
required: true,
},
groupnameId: {
type: String,
},
@@ -29,6 +30,10 @@ const CircuitSchema = new Schema({
type: String,
unique: true,
},
path: {
type: String,
unique: true,
},
subname: {
type: String,
},
@@ -188,7 +193,9 @@ CircuitSchema.statics.getWhatToShow = function(idapp, username) {
// FOR ME, PERMIT ALL
return {
Num: 1,
circuitId: 1,
groupnameId: 1,
path: 1,
name: 1,
subname: 1,
longdescr: 1,
@@ -204,10 +211,20 @@ CircuitSchema.statics.getWhatToShow = function(idapp, username) {
};
// Rimuovi dagli Admin del Circuito
MyGroupSchema.statics.removeAdminOfMyCircuit = async function(idapp, username, name) {
return Circuit.updateOne({idapp, name},
{$pull: {admins: {username: {$in: [username]}}}});
};
CircuitSchema.statics.getWhatToShow_Unknown = function(idapp, username) {
return {
Num: 1,
circuitId: 1,
groupnameId: 1,
path: 1,
name: 1,
subname: 1,
longdescr: 1,