tango-app-api-client 3.4.0-beta.1 → 3.4.0-beta.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
|
@@ -2655,7 +2655,9 @@ export async function getActivityLogs( req, res ) {
|
|
|
2655
2655
|
if ( ( ( hit?._source?.eventType ).match( /update/ ) || ( hit?._source?.eventType ).match( /edit/ ) )&& hit?._source?.previous ) {
|
|
2656
2656
|
const previous = hit?._source?.oldData;
|
|
2657
2657
|
const current=hit?._source?.newData;
|
|
2658
|
-
|
|
2658
|
+
if ( previous && current ) {
|
|
2659
|
+
respo = findDifferences( previous, current );
|
|
2660
|
+
}
|
|
2659
2661
|
hit._source.updatedValue = respo;
|
|
2660
2662
|
temp.push( hit?._source );
|
|
2661
2663
|
// hit._source.changes =logSubType === 'ticketConfig'? Object.keys( respo ).map( ( item ) => item ) : hit._source.changes;
|
|
@@ -2675,6 +2677,7 @@ export async function getActivityLogs( req, res ) {
|
|
|
2675
2677
|
}
|
|
2676
2678
|
|
|
2677
2679
|
function findDifferences( oldData, newData ) {
|
|
2680
|
+
logger.info( { oldData: oldData, newData: newData } );
|
|
2678
2681
|
const allKeys = new Set( [ ...Object.keys( oldData ), ...Object.keys( newData ) ] );
|
|
2679
2682
|
const diff = {};
|
|
2680
2683
|
|
|
@@ -2695,7 +2698,9 @@ function findDifferences( oldData, newData ) {
|
|
|
2695
2698
|
}
|
|
2696
2699
|
|
|
2697
2700
|
function splitCamelCase( text ) {
|
|
2698
|
-
return text.replace( /([a-z])([A-Z])/g, '$1 $2' )
|
|
2701
|
+
return text.replace( /([a-z])([A-Z])/g, '$1 $2' ) // Add space between camelCase words
|
|
2702
|
+
.replace( /(\d+)/g, ' $1 ' ) // Add space between numbers
|
|
2703
|
+
.trim();
|
|
2699
2704
|
}
|
|
2700
2705
|
|
|
2701
2706
|
async function postApi( url, data ) {
|