tango-app-api-trax 3.8.3 → 3.8.4

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.3",
3
+ "version": "3.8.4",
4
4
  "description": "Trax",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -169,10 +169,12 @@ export const checklistDropdown = async ( req, res ) => {
169
169
 
170
170
  let findQuery = [];
171
171
  let findAndQuery = [];
172
+ let type = req.body?.type == 'aiChecklist' ? { checkListType: { $ne: 'custom' } } : { checkListType: 'custom' };
172
173
  findAndQuery.push(
173
174
  { client_id: requestData.clientId },
174
175
  { date_iso: { $gte: fromDate } },
175
176
  { date_iso: { $lte: toDate } },
177
+ type,
176
178
  // { checkListType: { $eq: 'custom' } },
177
179
  );
178
180
 
@@ -2150,15 +2150,11 @@ export async function AiPushNotificationAlert( req, res ) {
2150
2150
 
2151
2151
  export async function liveAiPushNotificationAlert( req, res ) {
2152
2152
  try {
2153
- // console.log( req.body );
2154
- let findAichecklist = await PCLconfig.findOne( { checkListType: req.body.checkListType, client_id: req.body.clientId, date_string: req.body.Date }, { aiConfig: 1 } );
2155
- if ( findAichecklist?.aiConfig?.alertConfig?.mobile.length ) {
2156
- // console.log( findAichecklist.aiConfig.alerts.users );
2157
- for ( let user of findAichecklist?.aiConfig?.alertConfig?.mobile ) {
2153
+ let findAichecklist = await CLconfig.findOne( { checkListType: req.body.checkListType, client_id: req.body.client_id }, { aiConfig: 1 } );
2154
+ if ( findAichecklist?.aiConfig?.alertConfig?.alertSendTo?.mobile.length ) {
2155
+ for ( let user of findAichecklist?.aiConfig?.alertConfig?.alertSendTo?.mobile ) {
2158
2156
  let findOneUser = await userService.findOne( { email: user.value }, { fcmToken: 1 } );
2159
- // console.log( findOneUser );
2160
2157
  if ( findOneUser&&findOneUser.fcmToken&&findOneUser.fcmToken!='' ) {
2161
- // console.log( findOneUser.fcmToken );
2162
2158
  try {
2163
2159
  await sendPushNotification( req.body.title, req.body.description, findOneUser.fcmToken );
2164
2160
  } catch ( e ) {