Add to the Circuit

Remove to the Circuit
Revoke request
Users Admins
This commit is contained in:
paoloar77
2022-09-02 02:25:38 +02:00
parent f55d69b7fe
commit 6bee366547
20 changed files with 598 additions and 274 deletions

View File

@@ -41,12 +41,16 @@ const AccountSchema = new Schema({
saldo: {
type: Number,
},
deleted: {
type: Boolean,
default: false,
},
});
AccountSchema.statics.findAllIdApp = async function(idapp) {
const Account = this;
const myfind = {idapp};
const myfind = {idapp, deleted: false};
return await Account.find(myfind, (err, arrrec) => {
return arrrec;
@@ -79,7 +83,7 @@ AccountSchema.statics.getFieldsForSearch = function() {
AccountSchema.statics.executeQueryTable = function(idapp, params) {
params.fieldsearch = this.getFieldsForSearch();
return tools.executeQueryTable(this, 0, params);
return tools.executeQueryTable(this, idapp, params);
};
AccountSchema.statics.getAccountsByUsername = async function(idapp, username) {
@@ -93,7 +97,7 @@ AccountSchema.statics.getAccountsByUsername = async function(idapp, username) {
'username': username,
};
return await Account.find(myquery);
return await Account.find(myquery).lean();
};