Browse Source

isCurated - handle as optional

Leszek Wiesner 4 years ago
parent
commit
3970c5a934

+ 2 - 2
query-node/mappings/content-directory/entity/create.ts

@@ -61,7 +61,7 @@ async function createChannel(
   channel.id = id
   channel.title = p.title
   channel.description = p.description
-  channel.isCurated = p.isCurated
+  channel.isCurated = !!p.isCurated
   channel.isPublic = p.isPublic
   channel.coverPhotoUrl = p.coverPhotoUrl
   channel.avatarPhotoUrl = p.avatarPhotoUrl
@@ -216,7 +216,7 @@ async function createVideo(
   video.description = p.description
   video.duration = p.duration
   video.hasMarketing = p.hasMarketing
-  video.isCurated = p.isCurated
+  video.isCurated = !!p.isCurated
   video.isExplicit = p.isExplicit
   video.isPublic = p.isPublic
   video.publishedBeforeJoystream = p.publishedBeforeJoystream

+ 2 - 2
query-node/mappings/types.ts

@@ -45,7 +45,7 @@ export interface IChannel {
   coverPhotoUrl: string
   avatarPhotoUrl: string
   isPublic: boolean
-  isCurated: boolean
+  isCurated?: boolean
   language?: IReference
 }
 
@@ -107,7 +107,7 @@ export interface IVideo {
   hasMarketing?: boolean
   publishedBeforeJoystream?: number
   isPublic: boolean
-  isCurated: boolean
+  isCurated?: boolean
   isExplicit: boolean
   license?: IReference
 }