From 848da37295ff449a0ac04c0453800cb77d65ed6f Mon Sep 17 00:00:00 2001 From: Vraj Patel <155960201+vrajpatelTH@users.noreply.github.com> Date: Tue, 8 Oct 2024 11:40:27 +0530 Subject: [PATCH] fix(htw-293): fix depth issue get globals (#13) * fix(htw-293): fix the bug to fetch nested field while fetch the global by GraphQL query * chore(htw-293): remove package-lock.json file * chore(htw-293): restore yarn.lock file --- .gitignore | 1 + dist/hooks/global.js | 1 + package.json | 2 +- src/hooks/global.ts | 1 + yarn.lock | 2 +- 5 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index ef41f3c..019af54 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /node_modules /uploads /.yarn/cache +.vscode diff --git a/dist/hooks/global.js b/dist/hooks/global.js index 6576ad9..07f2a86 100644 --- a/dist/hooks/global.js +++ b/dist/hooks/global.js @@ -166,6 +166,7 @@ var getGlobal = function (_a) { equals: extractTenantId({ options: options, req: req }), }, }, + depth: 0, limit: 1, })]; case 1: diff --git a/package.json b/package.json index 549029c..ed2e3ba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "payload-tenancy", - "version": "2.1.3", + "version": "2.1.4", "description": "Multi-tenancy plugin for Payload CMS", "repository": { "type": "git", diff --git a/src/hooks/global.ts b/src/hooks/global.ts index e5462cf..8450539 100644 --- a/src/hooks/global.ts +++ b/src/hooks/global.ts @@ -166,6 +166,7 @@ const getGlobal = async ({ equals: extractTenantId({ options, req }), }, }, + depth: 0, limit: 1, }); return doc; diff --git a/yarn.lock b/yarn.lock index 881b372..149d102 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11530,4 +11530,4 @@ yocto-queue@^0.1.0: zod@^3.20.2: version "3.22.4" resolved "https://registry.yarnpkg.com/zod/-/zod-3.22.4.tgz#f31c3a9386f61b1f228af56faa9255e845cf3fff" - integrity sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg== + integrity sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg== \ No newline at end of file