MASTER feat(Docuware): refs #8066 use oath #3084

Merged
alexm merged 7 commits from 8066-docuware_oauth into master 2024-10-17 07:09:08 +00:00
1 changed files with 6 additions and 7 deletions
Showing only changes of commit b1b36a33a0 - Show all commits

View File

@ -56,8 +56,8 @@ 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);
if (!process.env.NODE_ENV)
return Math.floor(Math.random() + 100);
const docuwareInfo = await Self.app.models.Docuware.findOne({
where: {
@ -83,8 +83,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({
@ -93,7 +93,6 @@ module.exports = Self => {
}
});
console.log('options.headers: ', options.headers);
const fileCabinetResponse = await axios.get(`${options.url}/FileCabinets`, options.headers);
const fileCabinets = fileCabinetResponse.data.FileCabinet;
const fileCabinetId = fileCabinets.find(fileCabinet => fileCabinet.Name === docuwareInfo.fileCabinetName).Id;
@ -110,7 +109,7 @@ module.exports = Self => {
* @return {object} - The data
*/
Self.get = async(code, filter, parse) => {
// if (!process.env.NODE_ENV) return;
if (!process.env.NODE_ENV) return;
const options = await Self.getOptions();
const fileCabinetId = await Self.getFileCabinet(code);
@ -133,7 +132,7 @@ module.exports = Self => {
* @return {object} - The data
*/
Self.getById = async(code, id, parse) => {
// if (!process.env.NODE_ENV) return;
if (!process.env.NODE_ENV) return;
const docuwareInfo = await Self.app.models.Docuware.findOne({
fields: ['findById'],