fix: refs #5926 remove validation

This commit is contained in:
Javier Segarra 2024-06-06 15:55:58 +02:00
parent 0ffbe75a01
commit c919c99aaf
2 changed files with 6 additions and 11 deletions

View File

@ -87,9 +87,6 @@ module.exports = Self => {
* @return {number} - The fileCabinet id
*/
Self.getDialog = async(code, action, fileCabinetId) => {
if (!process.env.NODE_ENV)
return Math.floor(Math.random() + 100);
const docuwareInfo = await Self.getDocuware({
where: {
code,
@ -114,8 +111,8 @@ module.exports = Self => {
* @return {number} - The fileCabinet id
*/
Self.getFileCabinet = async code => {
if (!process.env.NODE_ENV)
return Math.floor(Math.random() + 100);
// if (!process.env.NODE_ENV)
// return Math.floor(Math.random() + 100);
const options = await Self.getOptions();
const docuwareInfo = await Self.app.models.Docuware.findOne({
@ -140,8 +137,6 @@ module.exports = Self => {
* @return {object} - The data
*/
Self.get = async(code, filter, parse) => {
if (!process.env.NODE_ENV) return;
const options = await Self.getOptions();
const fileCabinetId = await Self.getFileCabinet(code);
const dialogId = await Self.getDialog(code, 'find', fileCabinetId);

View File

@ -47,7 +47,7 @@ module.exports = Self => {
const docuwareOptions = await Self.getOptions();
const docuware = await Self.getDocuware({where: {code: fileCabinet, action}});
const {modelFk, fileCabinetName} = docuware;
const {modelFk} = docuware;
const modelIsValid = await Self.app.models.Module.findOne({where: {code: modelFk}});
if (!modelIsValid)
@ -55,10 +55,10 @@ module.exports = Self => {
const model = modelFk.replace(/^.{1}/g, modelFk[0].toUpperCase());
const fileCabinetId = await Self.getFileCabinet(fileCabinetName);
const dialogId = await Self.getDialog(fileCabinetName, action, fileCabinetId);
const fileCabinetId = await Self.getFileCabinet(fileCabinet);
const dialogId = await Self.getDialog(fileCabinet, action, fileCabinetId);
const uri = `${docuwareOptions.url}/FileCabinets/${fileCabinetName}/Documents`;
const uri = `${docuwareOptions.url}/FileCabinets/${fileCabinetId}/Documents`;
// if (!isProduction(false))
// throw new UserError('Action not allowed on the test environment');