- fix: se salvavo un record 'settable' e non era completo con tutti i campi, andava a troncare gli altri precedentemente inseriti
- ordinamento Circuiti per stato e numiscritti e descr
This commit is contained in:
@@ -225,9 +225,7 @@ CircuitSchema.statics.findAllIdApp = async function (idapp) {
|
||||
|
||||
const whatToShow = this.getWhatToShow(idapp, '');
|
||||
|
||||
return await Circuit.find(myfind, whatToShow, (err, arrrec) => {
|
||||
return arrrec;
|
||||
});
|
||||
return await Circuit.find(myfind, whatToShow).sort({status: -1, numMembers: -1, name: 1});
|
||||
};
|
||||
|
||||
CircuitSchema.statics.getFieldsForSearch = function () {
|
||||
@@ -372,14 +370,14 @@ CircuitSchema.statics.getCircuitsByUsername = async function (idapp, username, u
|
||||
$or: [
|
||||
{ deleted: { $exists: false } },
|
||||
{ deleted: { $exists: true, $eq: false } }],
|
||||
}).lean();
|
||||
}).sort({status: -1, numMembers: -1, name: 1}).lean();
|
||||
|
||||
let listcircuits = await Circuit.find({
|
||||
idapp,
|
||||
$or: [
|
||||
{ deleted: { $exists: false } },
|
||||
{ deleted: { $exists: true, $eq: false } }],
|
||||
}, whatToShow_Unknown).lean();
|
||||
}, whatToShow_Unknown).sort({status: -1, numMembers: -1, name: 1}).lean();
|
||||
|
||||
let asked_circuits = await Circuit.find({
|
||||
idapp,
|
||||
@@ -389,7 +387,7 @@ CircuitSchema.statics.getCircuitsByUsername = async function (idapp, username, u
|
||||
$or: [
|
||||
{ deleted: { $exists: false } },
|
||||
{ deleted: { $exists: true, $eq: false } }],
|
||||
}, whatToShow_Unknown).lean();
|
||||
}, whatToShow_Unknown).sort({status: -1}).lean();
|
||||
|
||||
let refused_circuits = await Circuit.find({
|
||||
idapp,
|
||||
@@ -399,7 +397,7 @@ CircuitSchema.statics.getCircuitsByUsername = async function (idapp, username, u
|
||||
$or: [
|
||||
{ deleted: { $exists: false } },
|
||||
{ deleted: { $exists: true, $eq: false } }],
|
||||
}, whatToShow_Unknown).lean();
|
||||
}, whatToShow_Unknown).sort({status: -1}).lean();
|
||||
|
||||
return {
|
||||
listcircuits,
|
||||
|
||||
Reference in New Issue
Block a user