tango-app-api-task 1.0.0-alpha.11 → 1.0.0-alpha.13
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
|
@@ -668,7 +668,7 @@ async function taskDropdownListData( requestData ) {
|
|
|
668
668
|
return res.sendError( error, 500 );
|
|
669
669
|
}
|
|
670
670
|
}
|
|
671
|
-
export const
|
|
671
|
+
export const taskDropdownListV1 = async ( req, res ) => {
|
|
672
672
|
try {
|
|
673
673
|
let requestData = req.body;
|
|
674
674
|
let result = {};
|
|
@@ -713,7 +713,7 @@ export const taskDropdownListV1OLD = async ( req, res ) => {
|
|
|
713
713
|
return res.sendError( { error: error }, 500 );
|
|
714
714
|
}
|
|
715
715
|
};
|
|
716
|
-
export const
|
|
716
|
+
export const taskDropdownListNew = async ( req, res ) => {
|
|
717
717
|
try {
|
|
718
718
|
let requestData = req.body;
|
|
719
719
|
let fromDate = new Date( requestData.fromDate );
|
|
@@ -776,6 +776,8 @@ export const taskDropdownListV1 = async ( req, res ) => {
|
|
|
776
776
|
scheduleStartTime: 1,
|
|
777
777
|
sourceCheckList_id: '$_id',
|
|
778
778
|
storeCount: 1,
|
|
779
|
+
submitTime_string: 1,
|
|
780
|
+
scheduleEndTimeISO: 1,
|
|
779
781
|
},
|
|
780
782
|
},
|
|
781
783
|
], as: 'checklistData',
|
|
@@ -784,17 +786,19 @@ export const taskDropdownListV1 = async ( req, res ) => {
|
|
|
784
786
|
{ $unwind: { path: '$checklistData', preserveNullAndEmptyArrays: true } },
|
|
785
787
|
{
|
|
786
788
|
$project: {
|
|
787
|
-
|
|
789
|
+
sourceCheckList_id: '$checklistData._id',
|
|
788
790
|
checkListName: '$checklistData.checkListName',
|
|
789
791
|
checkListNameLowercase: { $toLower: '$checkListName' },
|
|
790
792
|
checkListType: '$checklistData.checkListType',
|
|
791
793
|
createdByName: '$checklistData.createdByName',
|
|
794
|
+
storeCount: '$checklistData.storeCount',
|
|
795
|
+
scheduleEndTimeISO: '$checklistData.scheduleEndTimeISO',
|
|
796
|
+
submitTime_string: '$checklistData.submitTime_string',
|
|
797
|
+
_id: '$checklistData._id',
|
|
792
798
|
publish: '$checklistData.publish',
|
|
793
799
|
scheduleEndTime: '$checklistData.scheduleEndTime',
|
|
794
800
|
scheduleRepeatedType: '$checklistData.scheduleRepeatedType',
|
|
795
801
|
scheduleStartTime: '$checklistData.scheduleStartTime',
|
|
796
|
-
sourceCheckList_id: '$checklistData._id',
|
|
797
|
-
storeCount: '$checklistData.storeCount',
|
|
798
802
|
},
|
|
799
803
|
},
|
|
800
804
|
];
|
|
@@ -809,7 +813,7 @@ export const taskDropdownListV1 = async ( req, res ) => {
|
|
|
809
813
|
return res.sendError( { error: 'No Data Found' }, 204 );
|
|
810
814
|
}
|
|
811
815
|
result.totalCount = getChecklistData.length;
|
|
812
|
-
result.
|
|
816
|
+
result.taskDropdown = getChecklistData;
|
|
813
817
|
return res.sendSuccess( result );
|
|
814
818
|
} catch ( error ) {
|
|
815
819
|
console.log( 'error =>', error );
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
2
|
export const taskDashboardRouter = express.Router();
|
|
3
|
+
import { isAllowedSessionHandler, accessVerification, isAllowedClient } from 'tango-app-api-middleware';
|
|
3
4
|
|
|
4
5
|
import {
|
|
5
6
|
overallCards, taskTable, taskInfoTable, taskDropdownList, taskTableV1, overallCardsV1, taskInfoTableV1, taskDropdownListV1, taskDeleteV1,
|
|
6
7
|
} from '../controllers/taskDashboard.controllers.js';
|
|
7
8
|
|
|
8
9
|
taskDashboardRouter
|
|
9
|
-
.post( '/overallcards', overallCards )
|
|
10
|
-
.post( '/overallcardsV1', overallCardsV1 )
|
|
11
|
-
.post( '/taskTable', taskTable )
|
|
12
|
-
.post( '/taskTableV1', taskTableV1 )
|
|
13
|
-
.post( '/taskInfoTable', taskInfoTable )
|
|
14
|
-
.post( '/taskInfoTableV1', taskInfoTableV1 )
|
|
15
|
-
.post( '/taskDropdownList', taskDropdownList )
|
|
16
|
-
.post( '/taskDropdownListV1', taskDropdownListV1 )
|
|
17
|
-
.post( '/taskDeleteV1', taskDeleteV1 );
|
|
10
|
+
.post( '/overallcards', isAllowedSessionHandler, overallCards )
|
|
11
|
+
.post( '/overallcardsV1', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'Task', permissions: [] } ] } ), overallCardsV1 )
|
|
12
|
+
.post( '/taskTable', isAllowedSessionHandler, taskTable )
|
|
13
|
+
.post( '/taskTableV1', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'Task', permissions: [] } ] } ), taskTableV1 )
|
|
14
|
+
.post( '/taskInfoTable', isAllowedSessionHandler, taskInfoTable )
|
|
15
|
+
.post( '/taskInfoTableV1', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'Task', permissions: [] } ] } ), taskInfoTableV1 )
|
|
16
|
+
.post( '/taskDropdownList', isAllowedSessionHandler, taskDropdownList )
|
|
17
|
+
.post( '/taskDropdownListV1', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'Task', permissions: [] } ] } ), taskDropdownListV1 )
|
|
18
|
+
.post( '/taskDeleteV1', isAllowedSessionHandler, taskDeleteV1 );
|
|
18
19
|
|
|
19
20
|
export default taskDashboardRouter;
|