tango-app-api-trax 3.8.22 → 3.8.24

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.8.22",
3
+ "version": "3.8.24",
4
4
  "description": "Trax",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -4253,7 +4253,7 @@ export async function recurringFlagAlert( req, res ) {
4253
4253
  ],
4254
4254
  },
4255
4255
  }, { _id: 1, checkListName: 1, recurringFlag: 1, notifyFlags: 1, approver: 1, client_id: 1 } );
4256
-
4256
+ console.log( JSON.stringify( checklistDetails ) );
4257
4257
  if ( !checklistDetails.length ) {
4258
4258
  return res.sendSuccess( 'No checklists configured for recurring flag' );
4259
4259
  }
@@ -4275,12 +4275,11 @@ export async function recurringFlagAlert( req, res ) {
4275
4275
  recipients = cl.approver.map( ( a ) => a?.value ).filter( Boolean );
4276
4276
  }
4277
4277
  recipients = [ ...recipients, ...nfUsers.map( ( u ) => u?.value ).filter( Boolean ) ];
4278
- } else {
4279
- if ( notifyType.includes( 'approver' ) && Array.isArray( cl.approver ) ) {
4280
- recipients = cl.approver.map( ( a ) => a?.value ).filter( Boolean );
4281
- }
4282
- recipients = [ ...recipients, ...users.map( ( u ) => u?.value ).filter( Boolean ) ];
4283
4278
  }
4279
+ if ( notifyType.includes( 'approver' ) && Array.isArray( cl.approver ) ) {
4280
+ recipients = cl.approver.map( ( a ) => a?.value ).filter( Boolean );
4281
+ }
4282
+ recipients = [ ...recipients, ...users.map( ( u ) => u?.value ).filter( Boolean ) ];
4284
4283
  recipients = [ ...new Set( recipients ) ];
4285
4284
 
4286
4285
  if ( !recipients.length ) return;
@@ -2247,7 +2247,9 @@ export async function submitChecklist( req, res ) {
2247
2247
  // };
2248
2248
  // await detectionService.create( detectionData );
2249
2249
  if ( requestData.submittype == 'submit' ) {
2250
- updateRecurringFlagTracker( getchecklist[0], requestData.questionAnswers, currentDateTime );
2250
+ if ( checklistDetails?.recurringFlag?.notifyType?.length ) {
2251
+ updateRecurringFlagTracker( getchecklist[0], requestData.questionAnswers, currentDateTime );
2252
+ }
2251
2253
  updateOpenSearch( req.user, requestData );
2252
2254
  let openSearch = JSON.parse( process.env.OPENSEARCH );
2253
2255
  // console.log( 'openSearch', openSearch );