Browse Source

query-node: remove redundant assignment for isTypeOf property

metmirr 4 years ago
parent
commit
7eaee7da7a

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

@@ -205,14 +205,12 @@ async function createVideoMedia(
     const { httpMediaLocation, joystreamMediaLocation } = m
     if (httpMediaLocation) {
       const mediaLoc = new HttpMediaLocation()
-      mediaLoc.isTypeOf = 'HttpMediaLocation'
       mediaLoc.port = httpMediaLocation.port
       mediaLoc.url = httpMediaLocation.url
       videoMedia.location = mediaLoc
     }
     if (joystreamMediaLocation) {
       const mediaLoc = new JoystreamMediaLocation()
-      mediaLoc.isTypeOf = 'JoystreamMediaLocation'
       mediaLoc.dataObjectId = joystreamMediaLocation.dataObjectId
       videoMedia.location = mediaLoc
     }
@@ -331,7 +329,7 @@ async function createLicense(
       nextEntityIdBeforeTransaction
     )
     const k = new KnownLicense()
-    k.isTypeOf = 'KnownLicense'
+    // k.isTypeOf = 'KnownLicense'
     k.code = kLicense.code
     k.description = kLicense.description
     k.name = kLicense.name

+ 0 - 4
query-node/mappings/content-directory/entity/update.ts

@@ -80,7 +80,6 @@ async function updateLicenseEntityPropertyValues(
     if (!kLicense) throw Error(`KnownLicense not found ${id}`)
 
     const k = new KnownLicense()
-    k.isTypeOf = 'KnownLicense'
     k.code = kLicense.code
     k.description = kLicense.description
     k.name = kLicense.name
@@ -94,7 +93,6 @@ async function updateLicenseEntityPropertyValues(
     if (!udl) throw Error(`UserDefinedLicense not found ${id}`)
 
     const u = new UserDefinedLicense()
-    u.isTypeOf = 'UserDefinedLicense'
     u.content = udl.content
     // Set the license type
     record.type = u
@@ -160,13 +158,11 @@ async function updateVideoMediaEntityPropertyValues(
 
     if (httpMediaLocation) {
       mediaLoc = new HttpMediaLocation()
-      mediaLoc.isTypeOf = typeof HttpMediaLocation
       mediaLoc.url = httpMediaLocation.url
       mediaLoc.port = httpMediaLocation.port
     }
     if (joystreamMediaLocation) {
       mediaLoc = new JoystreamMediaLocation()
-      mediaLoc.isTypeOf = typeof JoystreamMediaLocation
       mediaLoc.dataObjectId = joystreamMediaLocation.dataObjectId
     }
     props.location = undefined