فهرست منبع

Update deprecated InputParser method usage

Leszek Wiesner 4 سال پیش
والد
کامیت
01d020b915
2فایلهای تغییر یافته به همراه5 افزوده شده و 5 حذف شده
  1. 2 2
      cli/src/commands/media/updateChannel.ts
  2. 3 3
      cli/src/commands/media/updateVideo.ts

+ 2 - 2
cli/src/commands/media/updateChannel.ts

@@ -69,9 +69,9 @@ export default class UpdateChannelCommand extends ContentDirectoryCommandBase {
     if (confirmed) {
       saveOutputJson(output, `${inputJson.title}Channel.json`, inputJson)
       const inputParser = InputParser.createWithKnownSchemas(this.getOriginalApi())
-      const updateOperation = await inputParser.createEntityUpdateOperation(inputJson, 'Channel', channelId)
+      const updateOperations = await inputParser.getEntityUpdateOperations(inputJson, 'Channel', channelId)
       this.log('Sending the extrinsic...')
-      await this.sendAndFollowNamedTx(account, 'contentDirectory', 'transaction', [actor, [updateOperation]])
+      await this.sendAndFollowNamedTx(account, 'contentDirectory', 'transaction', [actor, updateOperations])
     }
   }
 }

+ 3 - 3
cli/src/commands/media/updateVideo.ts

@@ -84,13 +84,13 @@ export default class UpdateVideoCommand extends ContentDirectoryCommandBase {
 
     // Parse inputs into operations and send final extrinsic
     const inputParser = InputParser.createWithKnownSchemas(this.getOriginalApi())
-    const videoUpdateOperation = await inputParser.createEntityUpdateOperation(updatedProps, 'Video', videoId)
-    const licenseUpdateOperation = await inputParser.createEntityUpdateOperation(
+    const videoUpdateOperations = await inputParser.getEntityUpdateOperations(updatedProps, 'Video', videoId)
+    const licenseUpdateOperations = await inputParser.getEntityUpdateOperations(
       updatedLicense,
       'License',
       currentValues.license
     )
-    const operations = [videoUpdateOperation, licenseUpdateOperation]
+    const operations = [...videoUpdateOperations, ...licenseUpdateOperations]
     await this.sendAndFollowNamedTx(account, 'contentDirectory', 'transaction', [actor, operations], true)
   }
 }