tango-app-api-report 3.0.9-dev → 3.0.10-dev

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-report",
3
- "version": "3.0.9-dev",
3
+ "version": "3.0.10-dev",
4
4
  "description": "report",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -24,8 +24,8 @@
24
24
  "nodemailer": "^6.9.13",
25
25
  "nodemon": "^3.1.0",
26
26
  "swagger-ui-express": "^5.0.0",
27
- "tango-api-schema": "^2.0.103",
28
- "tango-app-api-middleware": "^1.0.81-dev",
27
+ "tango-api-schema": "^2.0.104",
28
+ "tango-app-api-middleware": "^1.0.73-test",
29
29
  "winston": "^3.12.0",
30
30
  "winston-daily-rotate-file": "^5.0.0"
31
31
  },
@@ -26,9 +26,10 @@ export async function createReport( req, res ) {
26
26
  logSubType: 'reportConfig',
27
27
  changes: [ `${req.body?.fileName}` ],
28
28
  eventType: 'create',
29
+ showTo: [ 'tango' ],
29
30
  };
30
31
 
31
- await insertOpenSearchData( 'tango-retail-activity-logs', logObj );
32
+ await insertOpenSearchData( appConfig.opensearch.activityLog, logObj );
32
33
  if ( createReport ) {
33
34
  res.sendSuccess( { result: 'Created Successfully' } );
34
35
  }
@@ -68,6 +69,9 @@ export async function getSingleReport( req, res ) {
68
69
 
69
70
  export async function updateReport( req, res ) {
70
71
  try {
72
+ const previousReport = await reportGetSingle( {
73
+ _id: req.params?.id,
74
+ } );
71
75
  const updateAck = await reportUpdate( {
72
76
  _id: req.params?.id, fileType: req.body?.fileType, email: req.body?.email, clientId: req.body?.clientId,
73
77
  } );
@@ -83,9 +87,13 @@ export async function updateReport( req, res ) {
83
87
  logSubType: 'reportConfig',
84
88
  changes: [ `Report id ${req.params?.id}` ],
85
89
  eventType: 'update',
90
+ showTo: [ 'tango' ],
91
+ current: req.body,
92
+ previous: previousReport,
93
+
86
94
  };
87
95
 
88
- await insertOpenSearchData( 'tango-retail-activity-logs', logObj );
96
+ await insertOpenSearchData( appConfig.opensearch.activityLog, logObj );
89
97
  if ( updateAck ) {
90
98
  res.sendSuccess( { result: 'Updated Successfully' } );
91
99
  }