tango-app-api-analysis-traffic 3.8.2-alpha.7 → 3.8.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
|
@@ -3,7 +3,7 @@ import express from 'express';
|
|
|
3
3
|
import { storeProcessedData, getconfig, revoptagging, getrevoptagging, revoptaggingcount, footFallImages, tagTempId, getCategorizedImages } from '../controllers/revop.controller.js';
|
|
4
4
|
import { isAllowedSessionHandler, validate } from 'tango-app-api-middleware';
|
|
5
5
|
import { footfallImagesValid, getCategorizedImagesValid, storeProcessedDataValid, tagTempIdValid } from '../dtos/revop.dtos.js';
|
|
6
|
-
import {
|
|
6
|
+
import { deleteTaggedDuplicate, getTaggingConfig, mappingConfig } from '../validations/revop.validation.js';
|
|
7
7
|
|
|
8
8
|
export const revopRouter = express.Router();
|
|
9
9
|
|
|
@@ -16,7 +16,7 @@ revopRouter
|
|
|
16
16
|
// new enhnacemnet (for footfall directory)
|
|
17
17
|
.get( '/store-processed-data', isAllowedSessionHandler, validate( storeProcessedDataValid ), storeProcessedData )
|
|
18
18
|
.get( '/footfall-images', isAllowedSessionHandler, validate( footfallImagesValid ), getTaggingConfig, footFallImages )
|
|
19
|
-
.post( '/tag-tempId', isAllowedSessionHandler, validate( tagTempIdValid ),
|
|
19
|
+
.post( '/tag-tempId', isAllowedSessionHandler, validate( tagTempIdValid ), deleteTaggedDuplicate, mappingConfig, tagTempId )
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
.post( '/get-categorized-images', isAllowedSessionHandler, validate( getCategorizedImagesValid ), getCategorizedImages );
|
|
@@ -196,22 +196,28 @@ export async function mappingConfig( req, res, next ) {
|
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
-
export async function
|
|
199
|
+
export async function deleteTaggedDuplicate( req, res, next ) {
|
|
200
200
|
try {
|
|
201
201
|
const inputData = req.body;
|
|
202
202
|
const openSearch = JSON.parse( process.env.OPENSEARCH );
|
|
203
203
|
const getQuery = {
|
|
204
|
-
query: {
|
|
205
|
-
|
|
206
|
-
|
|
204
|
+
'query': {
|
|
205
|
+
'bool': {
|
|
206
|
+
'must': [
|
|
207
|
+
{
|
|
208
|
+
'term': { parent: inputData?.tempId },
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
'term': { dateString: inputData?.dateString },
|
|
212
|
+
},
|
|
213
|
+
],
|
|
207
214
|
},
|
|
208
215
|
},
|
|
209
|
-
|
|
210
216
|
};
|
|
211
217
|
await deleteByQuery( openSearch.revop, getQuery );
|
|
212
218
|
next();
|
|
213
219
|
} catch ( error ) {
|
|
214
|
-
logger.error( { error: error, message: req.body, function: 'traffic-revop-
|
|
220
|
+
logger.error( { error: error, message: req.body, function: 'traffic-revop-deleteTaggedDuplicate' } );
|
|
215
221
|
next();
|
|
216
222
|
}
|
|
217
223
|
}
|