浏览代码

CLI: fix videoById function

iorveth 4 年之前
父节点
当前提交
e173d2a475
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      cli/examples/content/createVideo.json
  2. 1 1
      cli/src/Api.ts

+ 1 - 1
cli/examples/content/createVideo.json

@@ -8,7 +8,7 @@
     "title": "Title",
     "description": "Description",
     "video": 1,
-    "thumbnailPhoto": "1",
+    "thumbnailPhoto": 1,
     "duration": 10,
     "mediaPixelHeight": 20,
     "mediaPixelWidth": 50,

+ 1 - 1
cli/src/Api.ts

@@ -526,7 +526,7 @@ export default class Api {
   }
 
   async videoById(videoId: number): Promise<Video | null> {
-    const exists = !!(await this._api.query.content.entityById.size(videoId)).toNumber()
+    const exists = !!(await this._api.query.content.videoById.size(videoId)).toNumber()
     return exists ? await this._api.query.content.videoById<Video>(videoId) : null
   }