tango-app-api-report 3.3.1 → 3.3.2
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
|
@@ -49,13 +49,13 @@ reportRouter.get( '/get-report-list', isAllowedSessionHandler,
|
|
|
49
49
|
authorize( { userType: [ 'tango' ], access: [
|
|
50
50
|
{ featureName: 'manage', name: 'reports', permissions: [ 'isView' ] },
|
|
51
51
|
] } ),
|
|
52
|
-
validate( getReportListValid ),
|
|
52
|
+
validate( getReportListValid ), isFolderExist, getReportList );
|
|
53
53
|
|
|
54
54
|
reportRouter.get( '/download-report', isAllowedSessionHandler,
|
|
55
55
|
authorize( { userType: [ 'tango' ], access: [
|
|
56
56
|
{ featureName: 'manage', name: 'reports', permissions: [ 'isEdit' ] },
|
|
57
57
|
] } ),
|
|
58
|
-
validate( downloadReportValid ),
|
|
58
|
+
validate( downloadReportValid ), isFileExist, dowloadReport );
|
|
59
59
|
|
|
60
60
|
reportRouter.post( '/send-report', isAllowedSessionHandler,
|
|
61
61
|
authorize( { userType: [ 'tango' ], access: [
|
|
@@ -7,7 +7,7 @@ export async function isReportEnable( req, res, next ) {
|
|
|
7
7
|
const inputData = req.method !== 'GET'? req.body: req.query;
|
|
8
8
|
const getReportName = await findOneClient( { 'clientId': inputData.clientId, 'status': { $in: [ 'active', 'hold' ] }, 'reportConfigs.report': true }, { '_id': 0, 'reportConfigs.reportName': 1, 'clientName': 1 } );
|
|
9
9
|
if ( !getReportName ) {
|
|
10
|
-
return res.sendError( 'This action was
|
|
10
|
+
return res.sendError( 'This action was forbidden1', 403 );
|
|
11
11
|
}
|
|
12
12
|
req.report = getReportName;
|
|
13
13
|
return next();
|
|
@@ -27,7 +27,7 @@ export async function isSendReportEnable( req, res, next ) {
|
|
|
27
27
|
req.report = getReportName;
|
|
28
28
|
return next();
|
|
29
29
|
} catch ( error ) {
|
|
30
|
-
logger.error( { error: error, message: req.body, function: '
|
|
30
|
+
logger.error( { error: error, message: req.body, function: 'isSendReportEnable' } );
|
|
31
31
|
return res.sendError( error, 500 );
|
|
32
32
|
}
|
|
33
33
|
}
|