tango-app-api-audio-analytics 1.0.3 → 1.0.4
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
|
@@ -93,11 +93,11 @@ export async function getCohort( req, res ) {
|
|
|
93
93
|
const result = await searchOpenSearchData( 'tango-audio-config', query );
|
|
94
94
|
logger.info( { result } );
|
|
95
95
|
|
|
96
|
-
if ( !result || result?.hits?.hits?.length === 0 ) {
|
|
96
|
+
if ( !result || result?.body?.hits?.hits?.length === 0 ) {
|
|
97
97
|
return res.sendError( 'Cohort not found', 404 );
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
return res.sendSuccess( result?.hits?.hits?.[0]?._source );
|
|
100
|
+
return res.sendSuccess( result?.body?.hits?.hits?.[0]?._source );
|
|
101
101
|
} catch ( error ) {
|
|
102
102
|
const err = error.message || 'Internal Server Error';
|
|
103
103
|
logger.error( { error, message: req.params, function: 'getCohort' } );
|