From b5b85c4e74d009813f9a0ebac6e0a7ccb54f1182 Mon Sep 17 00:00:00 2001 From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com> Date: Mon, 25 Nov 2024 16:27:42 +0000 Subject: [PATCH] fix(nc-gui): update custom url update swagger file --- .../src/controllers/views.controller.ts | 5 +- packages/nocodb/src/schema/swagger-v2.json | 54 ++++++++++++------- packages/nocodb/src/schema/swagger.json | 54 ++++++++++++------- packages/nocodb/src/services/views.service.ts | 5 +- 4 files changed, 80 insertions(+), 38 deletions(-) diff --git a/packages/nocodb/src/controllers/views.controller.ts b/packages/nocodb/src/controllers/views.controller.ts index 4306ed78b9..6a97a3495e 100644 --- a/packages/nocodb/src/controllers/views.controller.ts +++ b/packages/nocodb/src/controllers/views.controller.ts @@ -150,7 +150,10 @@ export class ViewsController { async shareViewUpdate( @TenantContext() context: NcContext, @Param('viewId') viewId: string, - @Body() body: ViewUpdateReqType, + @Body() body: ViewUpdateReqType & { + custom_url_path?: string; + original_url?: string; + }, @Req() req: NcRequest, ) { return await this.viewsService.shareViewUpdate(context, { diff --git a/packages/nocodb/src/schema/swagger-v2.json b/packages/nocodb/src/schema/swagger-v2.json index cd018ecdb1..2cf8d1556b 100644 --- a/packages/nocodb/src/schema/swagger-v2.json +++ b/packages/nocodb/src/schema/swagger-v2.json @@ -2794,7 +2794,24 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SharedBaseReq" + "allOf":[ + { + "$ref": "#/components/schemas/SharedBaseReq" + }, + { + "type": "object", + "properties": { + "original_url": { + "$ref": "#/components/schemas/StringOrNull", + "description": "Original url to redirect from custom url path" + }, + "custom_url_path": { + "$ref": "#/components/schemas/StringOrNull", + "description": "Custom url path" + } + } + } + ] }, "examples": { "Example 1": { @@ -5301,7 +5318,24 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SharedViewReq" + "allOf":[ + { + "$ref": "#/components/schemas/SharedViewReq" + }, + { + "type": "object", + "properties": { + "original_url": { + "$ref": "#/components/schemas/StringOrNull", + "description": "Original url to redirect from custom url path" + }, + "custom_url_path": { + "$ref": "#/components/schemas/StringOrNull", + "description": "Custom url path" + } + } + } + ] } } }, @@ -19699,14 +19733,6 @@ "type": "string", "description": "The role given the target user", "example": "editor" - }, - "original_url": { - "$ref": "#/components/schemas/StringOrNull", - "description": "Original url user to redirect from custom url path" - }, - "custom_url_path": { - "$ref": "#/components/schemas/StringOrNull", - "description": "Custom url path" } }, "x-stoplight": { @@ -19867,14 +19893,6 @@ "password": { "$ref": "#/components/schemas/StringOrNull", "description": "Password to restrict access" - }, - "original_url": { - "$ref": "#/components/schemas/StringOrNull", - "description": "Original url user to redirect from custom url path" - }, - "custom_url_path": { - "$ref": "#/components/schemas/StringOrNull", - "description": "Custom url path" } }, "x-stoplight": { diff --git a/packages/nocodb/src/schema/swagger.json b/packages/nocodb/src/schema/swagger.json index 2205268073..27b619e89d 100644 --- a/packages/nocodb/src/schema/swagger.json +++ b/packages/nocodb/src/schema/swagger.json @@ -3259,7 +3259,24 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SharedBaseReq" + "allOf":[ + { + "$ref": "#/components/schemas/SharedBaseReq" + }, + { + "type": "object", + "properties": { + "original_url": { + "$ref": "#/components/schemas/StringOrNull", + "description": "Original url to redirect from custom url path" + }, + "custom_url_path": { + "$ref": "#/components/schemas/StringOrNull", + "description": "Custom url path" + } + } + } + ] }, "examples": { "Example 1": { @@ -5908,7 +5925,24 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SharedViewReq" + "allOf":[ + { + "$ref": "#/components/schemas/SharedViewReq" + }, + { + "type": "object", + "properties": { + "original_url": { + "$ref": "#/components/schemas/StringOrNull", + "description": "Original url to redirect from custom url path" + }, + "custom_url_path": { + "$ref": "#/components/schemas/StringOrNull", + "description": "Custom url path" + } + } + } + ] } } }, @@ -24818,14 +24852,6 @@ "type": "string", "description": "The role given the target user", "example": "editor" - }, - "original_url": { - "$ref": "#/components/schemas/StringOrNull", - "description": "Original url user to redirect from custom url path" - }, - "custom_url_path": { - "$ref": "#/components/schemas/StringOrNull", - "description": "Custom url path" } }, "x-stoplight": { @@ -24983,14 +25009,6 @@ "password": { "$ref": "#/components/schemas/StringOrNull", "description": "Password to restrict access" - }, - "original_url": { - "$ref": "#/components/schemas/StringOrNull", - "description": "Original url user to redirect from custom url path" - }, - "custom_url_path": { - "$ref": "#/components/schemas/StringOrNull", - "description": "Custom url path" } }, "x-stoplight": { diff --git a/packages/nocodb/src/services/views.service.ts b/packages/nocodb/src/services/views.service.ts index d6ea5ca209..29dd1d79eb 100644 --- a/packages/nocodb/src/services/views.service.ts +++ b/packages/nocodb/src/services/views.service.ts @@ -262,7 +262,10 @@ export class ViewsService { context: NcContext, param: { viewId: string; - sharedView: SharedViewReqType; + sharedView: SharedViewReqType & { + custom_url_path?: string; + original_url?: string + }; user: UserType; req: NcRequest; },