Browse Source

Update query-node/mappings/content/utils.ts

Co-authored-by: ondratra <ondratra@users.noreply.github.com>
Lezek123 3 years ago
parent
commit
65c75d3b77
1 changed files with 5 additions and 3 deletions
  1. 5 3
      query-node/mappings/content/utils.ts

+ 5 - 3
query-node/mappings/content/utils.ts

@@ -279,7 +279,9 @@ async function processNewAssets(ctx: EventContext & StoreContext, assets: NewAss
       resultAsset.urls = JSON.stringify(assetUrls.map((u) => u.toString()))
       return resultAsset
     })
-  } else if (assets.isUpload) {
+  }
+
+  if (assets.isUpload) {
     const assetsUploaded = assets.asUpload.object_creation_list.length
     // FIXME: Ideally the runtime would provide object ids in ChannelCreated/VideoCreated/ChannelUpdated(...) events
     const objects = await getMostRecentlyCreatedDataObjects(ctx.store, assetsUploaded)
@@ -288,9 +290,9 @@ async function processNewAssets(ctx: EventContext & StoreContext, assets: NewAss
       resultAsset.dataObjectId = o.id
       return resultAsset
     })
-  } else {
-    unexpectedData('Unrecognized assets type', assets.type)
   }
+
+  unexpectedData('Unrecognized assets type', assets.type)
 }
 
 function extractVideoSize(assets: NewAssets | undefined, assetIndex: number | null | undefined): number | undefined {