default min e max fido e accumulo, per Circuito
This commit is contained in:
@@ -413,6 +413,19 @@ router.post('/settable', authenticate, async (req, res) => {
|
||||
resolve(mytablerec._id && mytable.findById(mytablerec._id))
|
||||
});
|
||||
|
||||
// Controlla se esiste già questo record:
|
||||
if (shared_consts.TABLES_FIELDS_DESCR_AND_CITY_AND_USER.includes(params.table)) {
|
||||
if (mytablerec.isNew) {
|
||||
const trovatoDuplicato = await mytable.findOne({idapp: mytablerec.idapp, descr: mytablerec.descr, idCity: mytablerec.idCity, userId: mytablerec.userId }).lean();
|
||||
if (trovatoDuplicato) {
|
||||
// trovatoDuplicato
|
||||
return res.status(200).send({ code: server_constants.RIS_CODE_REC_DUPLICATED_DESCR_CITY_USER, msg: '' });
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return await myPromise
|
||||
.then(async (doupdate) => {
|
||||
if (doupdate)
|
||||
|
||||
Reference in New Issue
Block a user