Ver código fonte

query-node: remove querying relations for license entity

metmirr 4 anos atrás
pai
commit
7d7c6abf6c

+ 1 - 5
query-node/mappings/content-directory/entity/update.ts

@@ -34,7 +34,6 @@ import {
   KnownLicense,
   UserDefinedLicense,
 } from '../../../generated/graphql-server/src/modules/variants/variants.model'
-import { videoPropertyNamesWithId } from '../content-dir-consts'
 
 function getEntityIdFromReferencedField(ref: IReference, entityIdBeforeTransaction: number): string {
   const { entityId, existing } = ref
@@ -212,10 +211,7 @@ async function updateVideoEntityPropertyValues(
   }
   if (license) {
     const id = getEntityIdFromReferencedField(license, entityIdBeforeTransaction)
-    const licenseEntity = await db.get(LicenseEntity, {
-      where: { id },
-      relations: ['knownLicense', 'userdefinedLicense'],
-    })
+    const licenseEntity = await db.get(LicenseEntity, { where: { id } })
     if (!licenseEntity) throw Error(`License entity not found: ${id}`)
     record.license = licenseEntity
     props.license = undefined

+ 1 - 1
query-node/mappings/content-directory/get-or-create.ts

@@ -349,7 +349,7 @@ async function license(
 
   const id = generateEntityIdFromIndex(nextEntityIdBeforeTransaction + entityId)
   // could be created in the transaction
-  lic = await db.get(LicenseEntity, { where: { id }, relations: ['knownLicense', 'userdefinedLicense'] })
+  lic = await db.get(LicenseEntity, { where: { id } })
   if (lic) return lic
 
   const { properties } = findEntity(entityId, 'License', classEntityMap)