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