fix: refs #5926 remove validation
This commit is contained in:
parent
0ffbe75a01
commit
c919c99aaf
|
@ -87,9 +87,6 @@ module.exports = Self => {
|
||||||
* @return {number} - The fileCabinet id
|
* @return {number} - The fileCabinet id
|
||||||
*/
|
*/
|
||||||
Self.getDialog = async(code, action, fileCabinetId) => {
|
Self.getDialog = async(code, action, fileCabinetId) => {
|
||||||
if (!process.env.NODE_ENV)
|
|
||||||
return Math.floor(Math.random() + 100);
|
|
||||||
|
|
||||||
const docuwareInfo = await Self.getDocuware({
|
const docuwareInfo = await Self.getDocuware({
|
||||||
where: {
|
where: {
|
||||||
code,
|
code,
|
||||||
|
@ -114,8 +111,8 @@ module.exports = Self => {
|
||||||
* @return {number} - The fileCabinet id
|
* @return {number} - The fileCabinet id
|
||||||
*/
|
*/
|
||||||
Self.getFileCabinet = async code => {
|
Self.getFileCabinet = async code => {
|
||||||
if (!process.env.NODE_ENV)
|
// if (!process.env.NODE_ENV)
|
||||||
return Math.floor(Math.random() + 100);
|
// return Math.floor(Math.random() + 100);
|
||||||
|
|
||||||
const options = await Self.getOptions();
|
const options = await Self.getOptions();
|
||||||
const docuwareInfo = await Self.app.models.Docuware.findOne({
|
const docuwareInfo = await Self.app.models.Docuware.findOne({
|
||||||
|
@ -140,8 +137,6 @@ module.exports = Self => {
|
||||||
* @return {object} - The data
|
* @return {object} - The data
|
||||||
*/
|
*/
|
||||||
Self.get = async(code, filter, parse) => {
|
Self.get = async(code, filter, parse) => {
|
||||||
if (!process.env.NODE_ENV) return;
|
|
||||||
|
|
||||||
const options = await Self.getOptions();
|
const options = await Self.getOptions();
|
||||||
const fileCabinetId = await Self.getFileCabinet(code);
|
const fileCabinetId = await Self.getFileCabinet(code);
|
||||||
const dialogId = await Self.getDialog(code, 'find', fileCabinetId);
|
const dialogId = await Self.getDialog(code, 'find', fileCabinetId);
|
||||||
|
|
|
@ -47,7 +47,7 @@ module.exports = Self => {
|
||||||
|
|
||||||
const docuwareOptions = await Self.getOptions();
|
const docuwareOptions = await Self.getOptions();
|
||||||
const docuware = await Self.getDocuware({where: {code: fileCabinet, action}});
|
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}});
|
const modelIsValid = await Self.app.models.Module.findOne({where: {code: modelFk}});
|
||||||
|
|
||||||
if (!modelIsValid)
|
if (!modelIsValid)
|
||||||
|
@ -55,10 +55,10 @@ module.exports = Self => {
|
||||||
|
|
||||||
const model = modelFk.replace(/^.{1}/g, modelFk[0].toUpperCase());
|
const model = modelFk.replace(/^.{1}/g, modelFk[0].toUpperCase());
|
||||||
|
|
||||||
const fileCabinetId = await Self.getFileCabinet(fileCabinetName);
|
const fileCabinetId = await Self.getFileCabinet(fileCabinet);
|
||||||
const dialogId = await Self.getDialog(fileCabinetName, action, fileCabinetId);
|
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))
|
// if (!isProduction(false))
|
||||||
// throw new UserError('Action not allowed on the test environment');
|
// throw new UserError('Action not allowed on the test environment');
|
||||||
|
|
Loading…
Reference in New Issue