Browse Source

Merge remote-tracking branch 'arsen/featured_videos' into sumer-cli

Leszek Wiesner 3 years ago
parent
commit
8e27b7284c
1 changed files with 24 additions and 0 deletions
  1. 24 0
      cli/src/commands/content/setFeaturedVideos.ts

+ 24 - 0
cli/src/commands/content/setFeaturedVideos.ts

@@ -0,0 +1,24 @@
+import ContentDirectoryCommandBase from '../../base/ContentDirectoryCommandBase'
+
+export default class SetFeaturedVideosCommand extends ContentDirectoryCommandBase {
+  static description = 'Set featured videos.'
+
+  static args = [
+    {
+      name: 'featuredVideoIds',
+      required: true,
+      description: 'IDs of the featured videos',
+    },
+  ]
+
+  async run() {
+    const { featuredVideoIds } = this.parse(SetFeaturedVideosCommand).args
+
+    const currentAccount = await this.getRequiredSelectedAccount()
+    await this.requestAccountDecoding(currentAccount)
+
+    const actor = await this.getActor('Lead')
+
+    await this.sendAndFollowNamedTx(currentAccount, 'content', 'setFeaturedVideos', [actor, featuredVideoIds])
+  }
+}