From 66556492b6530c618b67727433c5223d78d29f14 Mon Sep 17 00:00:00 2001 From: William Chong <6198816+williamchong@users.noreply.github.com> Date: Wed, 18 Dec 2024 16:18:27 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=94=92=EF=B8=8F=20Add=20cors=20for=20?= =?UTF-8?q?bookstore=20api=20(#1988)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🔒️ Add cors for bookstore api * ➕ Add cors in src --- functions/package-lock.json | 1 + functions/package.json | 1 + src/package-lock.json | 13 +++++++++++++ src/package.json | 1 + src/server/api/routes/bookstore/index.js | 3 +++ 5 files changed, 19 insertions(+) diff --git a/functions/package-lock.json b/functions/package-lock.json index cc4053306..0858d6a55 100644 --- a/functions/package-lock.json +++ b/functions/package-lock.json @@ -29,6 +29,7 @@ "body-parser": "^1.18.3", "chokidar": "^3.5.3", "cookie-parser": "^1.4.4", + "cors": "^2.8.5", "cosmjs-types": "^0.8.0", "create-hash": "^1.2.0", "crisp-api": "^9.0.0", diff --git a/functions/package.json b/functions/package.json index 7063feee6..134e0630d 100644 --- a/functions/package.json +++ b/functions/package.json @@ -36,6 +36,7 @@ "body-parser": "^1.18.3", "chokidar": "^3.5.3", "cookie-parser": "^1.4.4", + "cors": "^2.8.5", "cosmjs-types": "^0.8.0", "create-hash": "^1.2.0", "crisp-api": "^9.0.0", diff --git a/src/package-lock.json b/src/package-lock.json index 1f5c10e09..565c78b81 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -29,6 +29,7 @@ "body-parser": "^1.18.3", "consola": "^2.5.6", "cookie-parser": "^1.4.4", + "cors": "^2.8.5", "cosmjs-types": "^0.8.0", "create-hash": "^1.2.0", "crisp-api": "^9.0.0", @@ -21746,6 +21747,18 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/cosmiconfig": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz", diff --git a/src/package.json b/src/package.json index 6add93a5b..2152f01f5 100644 --- a/src/package.json +++ b/src/package.json @@ -49,6 +49,7 @@ "body-parser": "^1.18.3", "consola": "^2.5.6", "cookie-parser": "^1.4.4", + "cors": "^2.8.5", "cosmjs-types": "^0.8.0", "create-hash": "^1.2.0", "crisp-api": "^9.0.0", diff --git a/src/server/api/routes/bookstore/index.js b/src/server/api/routes/bookstore/index.js index e74cf5904..639bb417e 100644 --- a/src/server/api/routes/bookstore/index.js +++ b/src/server/api/routes/bookstore/index.js @@ -1,4 +1,5 @@ const { Router } = require('express'); +const cors = require('cors'); const { IS_TESTNET } = require('../../../config/config'); @@ -11,6 +12,8 @@ const { handleRestfulError } = require('../../middleware/error'); const router = Router(); +router.use('/bookstore', cors({ origin: true })); + router.get('/bookstore/tags', async (req, res, next) => { try { const { limit: pageSize, offset } = req.query; From 42c4c6110587bae8146b783f2a04cf50b45627d2 Mon Sep 17 00:00:00 2001 From: William Chong Date: Wed, 18 Dec 2024 17:28:51 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E2=9C=A8=20Make=20publisher=20clickable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/NFTBook/ItemCard.vue | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/components/NFTBook/ItemCard.vue b/src/components/NFTBook/ItemCard.vue index e2e457633..f98205fbc 100644 --- a/src/components/NFTBook/ItemCard.vue +++ b/src/components/NFTBook/ItemCard.vue @@ -181,11 +181,21 @@ v-if="iscnWorkPublisher" class="flex flex-col justify-center min-w-0" > - - + + + +