tango-app-api-trax 3.4.1-activitylog-1 → 3.4.1-activitylog-3

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.4.1-activitylog-1",
3
+ "version": "3.4.1-activitylog-3",
4
4
  "description": "Trax",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -152,8 +152,8 @@ export const listLog = async ( req, res ) => {
152
152
  }
153
153
  if ( requestBody.type === 'task' ) {
154
154
  const sourceCheckListResult = await taskconfigService.aggregate( [
155
- // { $match: { 'owner.value': req.user.email } },
156
- { $match: { $or: [ { 'owner.value': req.user.email }, { 'approver.value': req.user.email } ] } },
155
+ { $match: { createdBy: req.user._id } },
156
+ // { $match: { $or: [ { 'owner.value': req.user.email }, { 'approver.value': req.user.email } ] } },
157
157
  { $group: { _id: null, checklistIds: { $push: { $toString: '$_id' } } } },
158
158
  { $project: { _id: 0, checklistIds: 1 } },
159
159
  ] );
@@ -190,7 +190,7 @@ export const listLog = async ( req, res ) => {
190
190
  if ( requestBody.searchValue ) {
191
191
  mustConditions.push( { multi_match: {
192
192
  'query': requestBody.searchValue,
193
- 'fields': [ 'checkListName', 'storeName', 'userEmail' ],
193
+ 'fields': [ 'checkListName', 'storeName', 'createdByEmail' ],
194
194
  'type': 'phrase_prefix',
195
195
  },
196
196
  } );
@@ -383,7 +383,7 @@ export async function redoChecklist( req, res ) {
383
383
  return res.sendError( 'section is not found', 400 );
384
384
  }
385
385
 
386
- let findQuestion = question[sectionIndex].questions.findIndex( ( ele ) => ele.uniqueNo == req.body.payload.uniqueNo );
386
+ let findQuestion = question[sectionIndex].questions.findIndex( ( ele ) => ele.qno == req.body.payload.qno );
387
387
 
388
388
  let data = { ...question[sectionIndex].questions[findQuestion], redo: true, redoComment: req.body.payload?.checklistDescription || '' };
389
389
  // if ( checklistDetails.client_id == '458' ) {