tango-app-api-store-builder 1.0.0-beta-46 → 1.0.0-beta-48

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-app-api-store-builder",
3
- "version": "1.0.0-beta-46",
3
+ "version": "1.0.0-beta-48",
4
4
  "description": "storeBuilder",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -417,15 +417,15 @@ export async function updateStatus( req, res ) {
417
417
 
418
418
  export async function updateAnswers( req, res ) {
419
419
  try {
420
- if ( !req.body.fixtureId ) {
421
- return res.sendError( 'No data found', 204 );
422
- }
423
-
424
420
  req.body.answers.forEach( ( ans ) => {
425
- if ( ans.image && ans.image.includes( 'http' ) ) {
421
+ if ( ans.image ) {
426
422
  ans.image = ans.image.split( '.com/' )[1].split( '?' )[0];
427
423
  ans.image = decodeURIComponent( ans.image );
428
424
  }
425
+ if ( ans.video ) {
426
+ ans.video = ans.video.split( '.com/' )[1].split( '?' )[0];
427
+ ans.video = decodeURIComponent( ans.video );
428
+ }
429
429
  } );
430
430
 
431
431
  let data = {
@@ -474,6 +474,14 @@ export async function getFixtureDetails( req, res ) {
474
474
  let imageUrl = await signedUrl( params );
475
475
  ans.image = imageUrl;
476
476
  }
477
+ if ( ans.video ) {
478
+ let params = {
479
+ Bucket: JSON.parse( process.env.BUCKET ).storeBuilder,
480
+ file_path: ans.video,
481
+ };
482
+ let imageUrl = await signedUrl( params );
483
+ ans.video = imageUrl;
484
+ }
477
485
  return ans;
478
486
  } ) );
479
487