Ver Fonte

Fix https://github.com/Joystream/atlas/issues/4141 (#127)

Leszek Wiesner há 1 ano atrás
pai
commit
87b64b952a
2 ficheiros alterados com 2 adições e 37 exclusões
  1. 0 35
      package-lock.json
  2. 2 2
      src/server-extension/resolvers/NftResolver/index.ts

+ 0 - 35
package-lock.json

@@ -27,7 +27,6 @@
         "graphql-tools": "^8.3.11",
         "haversine-distance": "^1.2.1",
         "lodash": "^4.17.21",
-        "node-cache": "^5.1.2",
         "patch-package": "^6.5.0",
         "pg": "8.8.0",
         "type-graphql": "^1.2.0-rc.1",
@@ -10656,25 +10655,6 @@
       "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz",
       "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA=="
     },
-    "node_modules/node-cache": {
-      "version": "5.1.2",
-      "resolved": "https://registry.npmjs.org/node-cache/-/node-cache-5.1.2.tgz",
-      "integrity": "sha512-t1QzWwnk4sjLWaQAS8CHgOJ+RAfmHpxFWmc36IWTiWHQfs0w5JDMBS1b1ZxQteo0vVVuWJvIUKHDkkeK7vIGCg==",
-      "dependencies": {
-        "clone": "2.x"
-      },
-      "engines": {
-        "node": ">= 8.0.0"
-      }
-    },
-    "node_modules/node-cache/node_modules/clone": {
-      "version": "2.1.2",
-      "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz",
-      "integrity": "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==",
-      "engines": {
-        "node": ">=0.8"
-      }
-    },
     "node_modules/node-fetch": {
       "version": "2.6.7",
       "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
@@ -21670,21 +21650,6 @@
       "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz",
       "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA=="
     },
-    "node-cache": {
-      "version": "5.1.2",
-      "resolved": "https://registry.npmjs.org/node-cache/-/node-cache-5.1.2.tgz",
-      "integrity": "sha512-t1QzWwnk4sjLWaQAS8CHgOJ+RAfmHpxFWmc36IWTiWHQfs0w5JDMBS1b1ZxQteo0vVVuWJvIUKHDkkeK7vIGCg==",
-      "requires": {
-        "clone": "2.x"
-      },
-      "dependencies": {
-        "clone": {
-          "version": "2.1.2",
-          "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz",
-          "integrity": "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w=="
-        }
-      }
-    },
     "node-fetch": {
       "version": "2.6.7",
       "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",

+ 2 - 2
src/server-extension/resolvers/NftResolver/index.ts

@@ -3,7 +3,7 @@ import { EntityManager } from 'typeorm'
 import { RequestFeaturedNftArgs, NftFeaturedRequstInfo, EndingAuctionsNftsArgs } from './types'
 import { ContextWithIP } from '../../check'
 import { extendClause, withHiddenEntities } from '../../../utils/sql'
-import { NftFeaturingRequest } from '../../../model'
+import { NftFeaturingRequest, OwnedNft as OwnedNftEntity } from '../../../model'
 import { OwnedNft } from '../baseTypes'
 import { randomAsHex } from '@polkadot/util-crypto'
 import { GraphQLResolveInfo } from 'graphql'
@@ -84,7 +84,7 @@ export class NftResolver {
     const em = await this.em()
     const { ip } = ctx
     return withHiddenEntities(em, async () => {
-      const nft = await em.findOne(OwnedNft, {
+      const nft = await em.findOne(OwnedNftEntity, {
         where: { id: nftId },
       })