Develop PDB 1

This commit is contained in:
Surya Paolo
2023-11-28 14:20:22 +01:00
parent 5aa6accfc5
commit a66cd610dd
4 changed files with 43 additions and 8 deletions

View File

@@ -66,6 +66,7 @@ const Cart = require('../models/cart');
const OrdersCart = require('../models/orderscart');
const Storehouse = require('../models/storehouse');
const Department = require('../models/department');
const { Category } = require('../models/category');
const Group = require('../models/group');
const tools = require('../tools/general');
@@ -373,6 +374,7 @@ router.post('/settable', authenticate, async (req, res) => {
if ((mydata['_id'] === undefined || mydata['_id'] === '' || (mytablerec.isNew && mydata['_id'] === 0)) && (mytablerec._id === undefined || mytablerec._id === '0')) {
mytablerec._id = new ObjectID();
mydata._id = new ObjectID();
mytablerec.isNew = true;
}
}
@@ -1403,6 +1405,7 @@ function load(req, res, version) {
let workers = User.getusersWorkersList(idapp);
let storehouses = Storehouse.findAllIdApp(idapp);
let departments = Department.findAllIdApp(idapp);
let categories = Category.findAllIdApp(idapp);
// SKILLS:
let levels = Level.findAllIdApp(idapp);
@@ -1486,6 +1489,7 @@ function load(req, res, version) {
mygroups,
listcircuits, // 37
myelems, // 38
categories, // 39
]).then((arrdata) => {
// console.table(arrdata);
let myuser = req.user;
@@ -1567,6 +1571,7 @@ function load(req, res, version) {
mygroups: arrdata[36],
listcircuits: arrdata[37],
myelems: arrdata[38],
categories: arrdata[39],
});
}