tango-app-api-audio-analytics 1.0.19 → 1.0.20
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
|
@@ -32,7 +32,7 @@ export async function createCohort( req, res ) {
|
|
|
32
32
|
updatedAt: new Date().toISOString(),
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
-
const result = await insertWithId( 'tango-audio-config
|
|
35
|
+
const result = await insertWithId( 'tango-audio-config', cohortId, cohortData );
|
|
36
36
|
logger.info( { result } );
|
|
37
37
|
|
|
38
38
|
if ( result && result.body && result.body.result === 'created' ) {
|
|
@@ -68,7 +68,7 @@ export async function createBulkCohort( req, res ) {
|
|
|
68
68
|
updatedAt: new Date().toISOString(),
|
|
69
69
|
};
|
|
70
70
|
|
|
71
|
-
const result = await insertWithId( 'tango-audio-config
|
|
71
|
+
const result = await insertWithId( 'tango-audio-config', cohortId, cohortData );
|
|
72
72
|
logger.info( { result } );
|
|
73
73
|
|
|
74
74
|
if ( result && result.body && result.body.result === 'created' ) {
|
|
@@ -119,7 +119,7 @@ export async function updateCohort( req, res ) {
|
|
|
119
119
|
doc_as_upsert: true,
|
|
120
120
|
};
|
|
121
121
|
|
|
122
|
-
const result = await updateOpenSearchData( 'tango-audio-config
|
|
122
|
+
const result = await updateOpenSearchData( 'tango-audio-config', cohortId, updatePayload );
|
|
123
123
|
logger.info( { result } );
|
|
124
124
|
|
|
125
125
|
if ( result && result.body && result.body.result === 'updated' ) {
|
|
@@ -145,7 +145,7 @@ export async function deleteCohort( req, res ) {
|
|
|
145
145
|
},
|
|
146
146
|
};
|
|
147
147
|
|
|
148
|
-
const result = await updateOpenSearchData( 'tango-audio-config
|
|
148
|
+
const result = await updateOpenSearchData( 'tango-audio-config', cohortId, updatePayload );
|
|
149
149
|
logger.info( { result } );
|
|
150
150
|
|
|
151
151
|
if ( result && result.body && result.body.result === 'updated' ) {
|
|
@@ -170,7 +170,7 @@ export async function getCohort( req, res ) {
|
|
|
170
170
|
},
|
|
171
171
|
};
|
|
172
172
|
|
|
173
|
-
const result = await searchOpenSearchData( 'tango-audio-config
|
|
173
|
+
const result = await searchOpenSearchData( 'tango-audio-config', query );
|
|
174
174
|
logger.info( { result } );
|
|
175
175
|
|
|
176
176
|
if ( !result || result?.body?.hits?.hits?.length === 0 ) {
|
|
@@ -205,7 +205,7 @@ export async function listCohortsByClient( req, res ) {
|
|
|
205
205
|
sort: [ { createdAt: { order: 'desc' } } ],
|
|
206
206
|
};
|
|
207
207
|
|
|
208
|
-
const result = await searchOpenSearchData( 'tango-audio-config
|
|
208
|
+
const result = await searchOpenSearchData( 'tango-audio-config', query );
|
|
209
209
|
logger.info( { result } );
|
|
210
210
|
|
|
211
211
|
const total = result?.body?.hits?.total?.value || 0;
|