tango-app-api-trax 3.3.1-beta-15 → 3.3.1-beta-16

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.3.1-beta-15",
3
+ "version": "3.3.1-beta-16",
4
4
  "description": "Trax",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -3144,39 +3144,39 @@ export async function checklistAssign( req, res ) {
3144
3144
  }
3145
3145
  }
3146
3146
 
3147
- // export async function removeAssign( req, res ) {
3148
- // try {
3149
- // if ( !req.body.id ) {
3150
- // return res.sendError( 'Id is required', 400 );
3151
- // }
3152
- // if ( !req.body.checkListId ) {
3153
- // return res.sendError( 'Checklist id is required', 400 );
3154
- // }
3155
- // let checklistDetails = await checklistService.findOne( { _id: req.body.checkListId } );
3156
- // if ( !checklistDetails ) {
3157
- // return res.sendError( 'No data found', 204 );
3158
- // }
3159
- // await assignedService.updateMany( { assignId: { $in: req.body.id } }, { isdeleted: true } );
3160
- // return res.sendSuccess( 'Details removed successfully' );
3161
- // } catch ( e ) {
3162
- // logger.error( { functionName: 'removeAssign', error: e } );
3163
- // return res.sendError( e, 500 );
3164
- // }
3165
- // }
3166
-
3167
- export async function deleteAssignList( req, res ) {
3147
+ export async function removeAssign( req, res ) {
3168
3148
  try {
3149
+ if ( !req.body.id ) {
3150
+ return res.sendError( 'Id is required', 400 );
3151
+ }
3169
3152
  if ( !req.body.checkListId ) {
3170
3153
  return res.sendError( 'Checklist id is required', 400 );
3171
3154
  }
3172
- let checklistDetails = await checklistService.findOne( { _id: req.body.checkListId, isdeleted: false } );
3155
+ let checklistDetails = await checklistService.findOne( { _id: req.body.checkListId } );
3173
3156
  if ( !checklistDetails ) {
3174
3157
  return res.sendError( 'No data found', 204 );
3175
3158
  }
3176
- await assignedService.updateMany( { checkListId: req.body.checkListId }, { isdeleted: true } );
3177
- return res.sendSuccess( 'Assign details removed successfully' );
3159
+ await assignedService.deleteMany( { assignId: { $in: req.body.id } } );
3160
+ return res.sendSuccess( 'Details removed successfully' );
3178
3161
  } catch ( e ) {
3179
- logger.error( { functionName: 'deleteAssignList', error: e } );
3162
+ logger.error( { functionName: 'removeAssign', error: e } );
3180
3163
  return res.sendError( e, 500 );
3181
3164
  }
3182
3165
  }
3166
+
3167
+ // export async function deleteAssignList( req, res ) {
3168
+ // try {
3169
+ // if ( !req.body.checkListId ) {
3170
+ // return res.sendError( 'Checklist id is required', 400 );
3171
+ // }
3172
+ // let checklistDetails = await checklistService.findOne( { _id: req.body.checkListId, isdeleted: false } );
3173
+ // if ( !checklistDetails ) {
3174
+ // return res.sendError( 'No data found', 204 );
3175
+ // }
3176
+ // await assignedService.updateMany( { checkListId: req.body.checkListId }, { isdeleted: true } );
3177
+ // return res.sendSuccess( 'Assign details removed successfully' );
3178
+ // } catch ( e ) {
3179
+ // logger.error( { functionName: 'deleteAssignList', error: e } );
3180
+ // return res.sendError( e, 500 );
3181
+ // }
3182
+ // }
@@ -26,8 +26,8 @@ traxRouter
26
26
  .get( '/predefinedChecklist', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ), validate( aichecklistValidation ), traxController.preDefinedChecklist )
27
27
  .post( '/selectAssign', validate( selectAssign ), traxController.selectAssign )
28
28
  .post( '/assign', isAllowedSessionHandler, traxController.checklistAssign )
29
- // .post( '/remove', isAllowedSessionHandler, traxController.removeAssign )
30
- .post( '/removeAssignList', isAllowedSessionHandler, traxController.deleteAssignList )
29
+ .post( '/remove', isAllowedSessionHandler, traxController.removeAssign )
30
+ // .post( '/removeAssignList', isAllowedSessionHandler, traxController.deleteAssignList )
31
31
  .post( '/assignUpload', isAllowedSessionHandler, traxController.assignChecklistUser );
32
32
 
33
33
  // isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ),