From 0657471051b0b1c10bc124a8ddccf955e22fc47d Mon Sep 17 00:00:00 2001 From: Pranav C Date: Fri, 7 Oct 2022 17:46:39 +0530 Subject: [PATCH] fix(api): correction in table count and sharedViewCount Signed-off-by: Pranav C --- packages/nocodb/src/lib/meta/api/utilApis.ts | 7 +++++-- scripts/sdk/swagger.json | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/nocodb/src/lib/meta/api/utilApis.ts b/packages/nocodb/src/lib/meta/api/utilApis.ts index c490fc55c8..c483b793e7 100644 --- a/packages/nocodb/src/lib/meta/api/utilApis.ts +++ b/packages/nocodb/src/lib/meta/api/utilApis.ts @@ -291,7 +291,10 @@ export async function getAggregatedMetaInfo(_req: Request, res: Response) { if (view.uuid) out.sharedKanbanCount++; } - if (view.uuid && view.password) out.sharedLockedCount++; + if (view.uuid) { + if (view.password) out.sharedLockedCount++; + out.sharedTotal++; + } return out; }, @@ -339,7 +342,7 @@ export async function getAggregatedMetaInfo(_req: Request, res: Response) { ); return { - tableCount: { table: tableCount.status, view: dbViewCount }, + tableCount: { table: tableCount, view: dbViewCount }, external: !project.is_meta, viewCount, webhookCount, diff --git a/scripts/sdk/swagger.json b/scripts/sdk/swagger.json index 31c890e036..8ac4d6eafd 100644 --- a/scripts/sdk/swagger.json +++ b/scripts/sdk/swagger.json @@ -5405,7 +5405,7 @@ "sharedTotal": { "type": "integer" }, - "sharedPasswordProtected": { + "sharedLockedCount": { "type": "integer" } } @@ -5463,7 +5463,7 @@ "sharedGalleryCount": 0, "sharedKanbanCount": 0, "sharedTotal": 0, - "sharedPasswordProtected": 0 + "sharedLockedCount": 0 }, "webhookCount": 0, "filterCount": 0, @@ -5483,7 +5483,7 @@ }, "examples": { "example-1": { - "value": "{\n \"projectCount\": 1,\n \"projects\": [\n {\n \"tableCount\": {\n \"table\": 3,\n \"view\": 0\n },\n \"viewCount\": {\n \"formCount\": 0,\n \"gridCount\": 3,\n \"galleryCount\": 0,\n \"kanbanCount\": 0,\n \"total\": 3,\n \"sharedFormCount\": 0,\n \"sharedGridCount\": 0,\n \"sharedGalleryCount\": 0,\n \"sharedKanbanCount\": 0,\n \"sharedTotal\": 0,\n \"sharedPasswordProtected\": 0\n },\n \"webhookCount\": 0,\n \"filterCount\": 0,\n \"sortCount\": 0,\n \"rowCount\": [\n {\n \"TotalRecords\": \"76\"\n }\n ],\n \"userCount\": 1\n }\n ],\n \"userCount\": 1,\n \"sharedBaseCount\": 0\n}" + "value": "{\n \"projectCount\": 1,\n \"projects\": [\n {\n \"tableCount\": {\n \"table\": 3,\n \"view\": 0\n },\n \"viewCount\": {\n \"formCount\": 0,\n \"gridCount\": 3,\n \"galleryCount\": 0,\n \"kanbanCount\": 0,\n \"total\": 3,\n \"sharedFormCount\": 0,\n \"sharedGridCount\": 0,\n \"sharedGalleryCount\": 0,\n \"sharedKanbanCount\": 0,\n \"sharedTotal\": 0,\n \"sharedLockedCount\": 0\n },\n \"webhookCount\": 0,\n \"filterCount\": 0,\n \"sortCount\": 0,\n \"rowCount\": [\n {\n \"TotalRecords\": \"76\"\n }\n ],\n \"userCount\": 1\n }\n ],\n \"userCount\": 1,\n \"sharedBaseCount\": 0\n}" } } }