tango-app-api-analysis-traffic 3.3.1-alpha.23 → 3.3.1-alpha.24
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
|
@@ -18,6 +18,7 @@ export async function revoptagging( req, res ) {
|
|
|
18
18
|
try {
|
|
19
19
|
const openSearch = JSON.parse( process.env.OPENSEARCH );
|
|
20
20
|
console.log( req.body );
|
|
21
|
+
console.log( req.body.length );
|
|
21
22
|
for ( let item of req.body ) {
|
|
22
23
|
let searchQuery={
|
|
23
24
|
'size': 1,
|
|
@@ -46,18 +47,18 @@ export async function revoptagging( req, res ) {
|
|
|
46
47
|
|
|
47
48
|
let respo= await getOpenSearchData( openSearch.revops, searchQuery );
|
|
48
49
|
const revopData = respo?.body?.hits?.hits;
|
|
49
|
-
console.log( '====>', revopData );
|
|
50
|
+
console.log( '====>data exists', revopData );
|
|
50
51
|
if ( revopData&& revopData.length>0 ) {
|
|
51
52
|
let result= await updateOpenSearchData( openSearch.revops, revopData[0]._id, { doc: item } );
|
|
52
53
|
console.log( result );
|
|
53
|
-
return res.sendSuccess( 'Customer has been tagged successfully' );
|
|
54
54
|
} else {
|
|
55
55
|
item.createdAt = new Date();
|
|
56
56
|
item.updatedAt = new Date();
|
|
57
|
+
console.log( 'insertData', item );
|
|
57
58
|
await insertOpenSearchData( openSearch.revops, item );
|
|
58
|
-
return res.sendSuccess( 'Customer has been tagged successfully.' );
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
+
return res.sendSuccess( 'Customer has been tagged successfully' );
|
|
61
62
|
} catch ( error ) {
|
|
62
63
|
logger.error( { error: error, message: req.query, function: 'revoptagging' } );
|
|
63
64
|
return res.sendError( { error: error }, 500 );
|