tango-app-api-trax 3.7.13-qid-halfshutter-15 → 3.7.14

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-app-api-trax",
3
- "version": "3.7.13-qid-halfshutter-15",
3
+ "version": "3.7.14",
4
4
  "description": "Trax",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -2629,7 +2629,7 @@ export async function getRunAIList( req, res ) {
2629
2629
  try {
2630
2630
  let getChecklistDetails = await CLconfig.find( { publish: true, ...( req.query.clientId && { client_id: req.query.clientId } ) } );
2631
2631
  if ( !getChecklistDetails.length ) {
2632
- return res.sendError( 'No data found', 204 );
2632
+ return res.sendSuccess( [] );
2633
2633
  }
2634
2634
  let runAIList=[];
2635
2635
  await Promise.all( getChecklistDetails.map( async ( check ) => {
@@ -1,4 +1,4 @@
1
- import { logger, signedUrl, fileUpload, getOtp, sendEmailWithSES, getUuid, insertOpenSearchData } from 'tango-app-api-middleware';
1
+ import { logger, signedUrl, fileUpload, getOtp, sendEmailWithSES, getUuid, insertOpenSearchData, listFileByPath, getObject, deleteFiles } from 'tango-app-api-middleware';
2
2
  import * as processedchecklist from '../services/processedchecklist.services.js';
3
3
  import * as processedtask from '../services/processedTaskList.service.js';
4
4
  import * as PCLconfig from '../services/processedchecklistconfig.services.js';
@@ -3781,7 +3781,7 @@ export async function uploadAnswerImage( req, res ) {
3781
3781
 
3782
3782
  imageUrl = await fileUpload( params );
3783
3783
  if ( imageUrl.errors && imageUrl.errors.length ) {
3784
- return res.sendError( imageUrl.errors[0].message, '400' );
3784
+ return res.sendError( imageUrl.errors[0].message, 400 );
3785
3785
  }
3786
3786
 
3787
3787
  if ( imageUrl != '' ) {
@@ -4393,7 +4393,7 @@ export async function chunkUpload( req, res ) {
4393
4393
  try {
4394
4394
  const { chunkIndex, totalChunks } = req.body;
4395
4395
  if ( chunkIndex === undefined || !totalChunks || !req.files || !req.files.answerImage ) {
4396
- return res.status( 400 ).json( { error: 'Missing required params or file.' } );
4396
+ return res.sendError( 'Missing required params or file.', 400 );
4397
4397
  }
4398
4398
  const chunkNum = Number( chunkIndex );
4399
4399
  const chunkTotal = Number( totalChunks );
@@ -3237,13 +3237,15 @@ export const flagTablesV2 = async ( req, res ) => {
3237
3237
  getChecklistPerformanceData[index].flaggedStores = findCheckList.flagStoreCount;
3238
3238
  }
3239
3239
  } else {
3240
- if ( requestData?.filter == 'all' ) {
3241
- getChecklistPerformanceData[index].runAIFlag = 0;
3242
- getChecklistPerformanceData[index].flagCount = resultData?.[getChecklistPerformanceData[index]?.checkListType] || 0;
3243
- getChecklistPerformanceData[index].flaggedStores = resultData?.[`${getChecklistPerformanceData[index]?.checkListType}_flaggedstores`] || 0;
3244
- } else {
3245
- getChecklistPerformanceData[index].flagCount = 0;
3246
- getChecklistPerformanceData[index].flaggedStores = 0;
3240
+ if ( getChecklistPerformanceData[index].checkListType !== 'custom' ) {
3241
+ if ( requestData?.filter == 'all' ) {
3242
+ getChecklistPerformanceData[index].runAIFlag = 0;
3243
+ getChecklistPerformanceData[index].flagCount = resultData?.[getChecklistPerformanceData[index]?.checkListType] || 0;
3244
+ getChecklistPerformanceData[index].flaggedStores = resultData?.[`${getChecklistPerformanceData[index]?.checkListType}_flaggedstores`] || 0;
3245
+ } else {
3246
+ getChecklistPerformanceData[index].flagCount = 0;
3247
+ getChecklistPerformanceData[index].flaggedStores = 0;
3248
+ }
3247
3249
  }
3248
3250
  }
3249
3251
  getChecklistPerformanceData[index].complianceRate = ( 100- ( getChecklistPerformanceData[index].flaggedStores / getChecklistPerformanceData[index].assignedStores ) * 100 );