Circuit go on...
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user