tango-app-api-trax 3.8.0 → 3.8.1

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.0",
3
+ "version": "3.8.1",
4
4
  "description": "Trax",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -4161,3 +4161,35 @@ export async function sendAIEmailList( req, res ) {
4161
4161
  return res.sendError( e, 500 );
4162
4162
  }
4163
4163
  }
4164
+
4165
+ export async function aiChecklistDetails( req, res ) {
4166
+ try {
4167
+ let query = [
4168
+ {
4169
+ $match: {
4170
+ publish: true,
4171
+ checkListType: { $ne: 'custom' },
4172
+ },
4173
+ },
4174
+ {
4175
+ $group: {
4176
+ _id: '$client_id',
4177
+ checklistName: { $addToSet: '$checkListName' },
4178
+ },
4179
+ },
4180
+ {
4181
+ $project: {
4182
+ clientId: '$_id',
4183
+ checklistName: 1,
4184
+ _id: 0,
4185
+ },
4186
+ },
4187
+ ];
4188
+
4189
+ let checklistDetails = await CLconfig.aggregate( query );
4190
+ return res.sendSuccess( checklistDetails );
4191
+ } catch ( e ) {
4192
+ logger.error( { functionName: 'aiChecklistDetails', error: e } );
4193
+ return res.sendError( e, 500 );
4194
+ }
4195
+ }
@@ -41,6 +41,7 @@ internalTraxRouter
41
41
  .get( '/checklistAutoMailList', isAllowedInternalAPIHandler, internalController.checklistAutoMailList )
42
42
  .post( '/sendAIEmailList', isAllowedInternalAPIHandler, internalController.sendAIEmailList )
43
43
  .post( '/liveAiPushNotificationAlert', isAllowedInternalAPIHandler, internalController.liveAiPushNotificationAlert )
44
+ .post( '/aiChecklistDetails', isAllowedInternalAPIHandler, internalController.aiChecklistDetails )
44
45
  ;
45
46
 
46
47