tango-app-api-task 3.6.2-bulktask-9 → 3.7.2-multireff-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -117,26 +117,26 @@ export async function createUpdateTask( req, res ) {
|
|
|
117
117
|
for ( let i = 0; i < inputBody?.sections?.length; i++ ) {
|
|
118
118
|
let section = inputBody.sections[i];
|
|
119
119
|
section.questions.forEach( ( section ) => {
|
|
120
|
-
if ( section.questionReferenceImage && section.questionReferenceImage.length ) {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
130
|
-
section.answers.forEach( ( answer ) => {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
} );
|
|
120
|
+
// if ( section.questionReferenceImage && section.questionReferenceImage.length ) {
|
|
121
|
+
// let image = [];
|
|
122
|
+
// for ( let img of section.questionReferenceImage ) {
|
|
123
|
+
// let imgUrl = decodeURIComponent( img.split( '?' )[0] );
|
|
124
|
+
// let url = imgUrl.split( '/' );
|
|
125
|
+
// url.splice( 0, 3 );
|
|
126
|
+
// image.push( url.join( '/' ) );
|
|
127
|
+
// }
|
|
128
|
+
// section.questionReferenceImage = image;
|
|
129
|
+
// }
|
|
130
|
+
// section.answers.forEach( ( answer ) => {
|
|
131
|
+
// if ( answer.referenceImage.length ) {
|
|
132
|
+
// answer.referenceImage = answer.referenceImage.map( ( value ) => {
|
|
133
|
+
// let imgUrl = decodeURIComponent( value?.split( '?' )[0] );
|
|
134
|
+
// let url = imgUrl.split( '/' );
|
|
135
|
+
// url.splice( 0, 3 );
|
|
136
|
+
// return url.join( '/' );
|
|
137
|
+
// } );
|
|
138
|
+
// }
|
|
139
|
+
// } );
|
|
140
140
|
} );
|
|
141
141
|
|
|
142
142
|
sectionList.push( {
|
|
@@ -256,7 +256,8 @@ export async function createUpdateTask( req, res ) {
|
|
|
256
256
|
},
|
|
257
257
|
userType: req?.user?.userType || '',
|
|
258
258
|
};
|
|
259
|
-
await insertOpenSearchData( JSON.parse( process.env.OPENSEARCH ).traxActivityLog, insertLogData );
|
|
259
|
+
// await insertOpenSearchData( JSON.parse( process.env.OPENSEARCH ).traxActivityLog, insertLogData );
|
|
260
|
+
insertOpenSearchData( JSON.parse( process.env.OPENSEARCH ).traxActivityLog, insertLogData );
|
|
260
261
|
}
|
|
261
262
|
} else {
|
|
262
263
|
let logObj = {
|
|
@@ -275,7 +276,8 @@ export async function createUpdateTask( req, res ) {
|
|
|
275
276
|
logDetails: {},
|
|
276
277
|
userType: req?.user?.userType || '',
|
|
277
278
|
};
|
|
278
|
-
await insertOpenSearchData( JSON.parse( process.env.OPENSEARCH ).traxActivityLog, logObj );
|
|
279
|
+
// await insertOpenSearchData( JSON.parse( process.env.OPENSEARCH ).traxActivityLog, logObj );
|
|
280
|
+
insertOpenSearchData( JSON.parse( process.env.OPENSEARCH ).traxActivityLog, logObj );
|
|
279
281
|
}
|
|
280
282
|
|
|
281
283
|
if ( inputBody?.submitType == 'save' ) {
|
|
@@ -295,7 +297,8 @@ export async function createUpdateTask( req, res ) {
|
|
|
295
297
|
logDetails: {},
|
|
296
298
|
userType: req?.user?.userType || '',
|
|
297
299
|
};
|
|
298
|
-
await insertOpenSearchData( JSON.parse( process.env.OPENSEARCH ).traxActivityLog, logObj );
|
|
300
|
+
// await insertOpenSearchData( JSON.parse( process.env.OPENSEARCH ).traxActivityLog, logObj );
|
|
301
|
+
insertOpenSearchData( JSON.parse( process.env.OPENSEARCH ).traxActivityLog, logObj );
|
|
299
302
|
}
|
|
300
303
|
return res.sendSuccess( { checklistId: checkListId, message: message } );
|
|
301
304
|
} else {
|
|
@@ -360,42 +363,42 @@ export async function taskDetails( req, res ) {
|
|
|
360
363
|
let questionDetails = await taskQuestionService.find( query );
|
|
361
364
|
if ( questionDetails.length ) {
|
|
362
365
|
let sections = [];
|
|
363
|
-
let bucket = JSON.parse( process.env.BUCKET );
|
|
366
|
+
// let bucket = JSON.parse( process.env.BUCKET );
|
|
364
367
|
questionDetails.forEach( ( item ) => {
|
|
365
|
-
item.question.forEach( async ( question ) => {
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
} );
|
|
368
|
+
// item.question.forEach( async ( question ) => {
|
|
369
|
+
// if ( question.questionReferenceImage && question.questionReferenceImage != '' && typeof question.questionReferenceImage == 'string' ) {
|
|
370
|
+
// let inputData = {
|
|
371
|
+
// Bucket: bucket.sop,
|
|
372
|
+
// file_path: decodeURIComponent( question.questionReferenceImage ),
|
|
373
|
+
// };
|
|
374
|
+
// question.questionReferenceImage = await signedUrl( inputData );
|
|
375
|
+
// } else {
|
|
376
|
+
// if ( question.questionReferenceImage.length ) {
|
|
377
|
+
// let image = [];
|
|
378
|
+
// for ( let img of question.questionReferenceImage ) {
|
|
379
|
+
// let inputData = {
|
|
380
|
+
// Bucket: bucket.sop,
|
|
381
|
+
// file_path: decodeURIComponent( img ),
|
|
382
|
+
// };
|
|
383
|
+
// image.push( await signedUrl( inputData ) );
|
|
384
|
+
// }
|
|
385
|
+
// question.questionReferenceImage = image;
|
|
386
|
+
// }
|
|
387
|
+
// }
|
|
388
|
+
// question.answers.forEach( async ( answer ) => {
|
|
389
|
+
// if ( answer.referenceImage.length > 0 ) {
|
|
390
|
+
// let updatedImages = [];
|
|
391
|
+
// for ( let refImage of answer.referenceImage ) {
|
|
392
|
+
// let inputData = {
|
|
393
|
+
// Bucket: bucket.sop,
|
|
394
|
+
// file_path: decodeURIComponent( refImage ),
|
|
395
|
+
// };
|
|
396
|
+
// updatedImages.push( await signedUrl( inputData ) );
|
|
397
|
+
// }
|
|
398
|
+
// answer.referenceImage = updatedImages;
|
|
399
|
+
// }
|
|
400
|
+
// } );
|
|
401
|
+
// } );
|
|
399
402
|
sections.push( {
|
|
400
403
|
id: item._id,
|
|
401
404
|
name: item.section,
|