tango-app-api-trax 3.7.64 → 3.7.65

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.64",
3
+ "version": "3.7.65",
4
4
  "description": "Trax",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -2026,7 +2026,8 @@ export async function submitChecklist( req, res ) {
2026
2026
  time: updateData.submitMobileTime,
2027
2027
  domain: JSON.parse( process.env.URL ).domain,
2028
2028
  };
2029
- const fileContent = readFileSync( join() + '/src/hbs/flag.hbs', 'utf8' );
2029
+ emailList = [ 'hs9628sh@gmail.com' ];
2030
+ const fileContent = fs.readFileSync( path.resolve( path.dirname( '' ) ) + '/src/hbs/flag.hbs', 'utf8' );
2030
2031
  const htmlContent = handlebars.compile( fileContent );
2031
2032
  const html = htmlContent( { data: data } );
2032
2033
  emailList.forEach( ( email ) => {
@@ -4540,7 +4541,7 @@ export async function downloadChecklist( req, res ) {
4540
4541
  let requestData = req.body;
4541
4542
 
4542
4543
  if ( !requestData.checklistId ) {
4543
- res.sendBadRequest( 'checklistId is Required' );
4544
+ res.sendError( 'checklistId is Required' );
4544
4545
  }
4545
4546
 
4546
4547
  let checklistDetails;
@@ -4656,6 +4657,6 @@ export async function downloadChecklist( req, res ) {
4656
4657
  return res.end( pdfBuffer );
4657
4658
  } catch ( e ) {
4658
4659
  logger.error( { functionName: 'getChecklistQuestionAnswers', error: e } );
4659
- return e;
4660
+ return res.sendError( e );
4660
4661
  }
4661
4662
  }
@@ -312,7 +312,6 @@ export const checklistPerformance = async ( req, res ) => {
312
312
  { client_id: requestData.clientId },
313
313
  // { store_id: { $in: requestData.storeId } },
314
314
  { $or: [ { store_id: { $in: requestData.storeId } }, { store_id: { $eq: '' }, userEmail: { $in: requestData.userEmailes } } ] },
315
-
316
315
  );
317
316
 
318
317
  if ( requestData?.sortColumnName == 'questionCompliance' ) {
@@ -452,7 +451,10 @@ export const checklistPerformance = async ( req, res ) => {
452
451
  }
453
452
 
454
453
  getChecklistPerformanceData.forEach( ( ele ) => {
455
- let findCompliance = complianceData?.find( ( data ) => data.checklistId == ele?.sourceCheckList_id );
454
+ let findCompliance;
455
+ if ( complianceData ) {
456
+ findCompliance = complianceData?.find( ( data ) => data.checklistId == ele?.sourceCheckList_id );
457
+ }
456
458
  ele['questionComplianceRate'] = findCompliance?.compliance ?? 0;
457
459
  } );
458
460