tango-app-api-trax 3.4.1-activitylog-2 → 3.4.1-activitylog-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.4.1-activitylog-2",
3
+ "version": "3.4.1-activitylog-4",
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
  } );
@@ -1022,8 +1022,8 @@ export const update = async ( req, res ) => {
1022
1022
  questionAdd: questionList.questionAdd,
1023
1023
  questionEdit: questionList.questionEdit,
1024
1024
  questionDelete: questionList.questionDelete,
1025
- userType: req.user.userType,
1026
1025
  },
1026
+ userType: req.user.userType,
1027
1027
  };
1028
1028
  insertOpenSearchData( JSON.parse( process.env.OPENSEARCH ).traxActivityLog, insertLogData );
1029
1029
  }