From af684ae79dc21167e41a308c9bdd348346888793 Mon Sep 17 00:00:00 2001 From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com> Date: Tue, 26 Nov 2024 05:46:57 +0000 Subject: [PATCH] fix(nc-gui): custom url oss changes --- packages/nocodb/src/models/Base.ts | 1 - packages/nocodb/src/models/View.ts | 9 +++++---- packages/nocodb/src/services/views.service.ts | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/nocodb/src/models/Base.ts b/packages/nocodb/src/models/Base.ts index 574ad18cc4..8e11f1928d 100644 --- a/packages/nocodb/src/models/Base.ts +++ b/packages/nocodb/src/models/Base.ts @@ -345,7 +345,6 @@ export default class Base implements BaseType { 'uuid', 'password', 'roles', - 'fk_custom_url_id', ]); // get existing cache diff --git a/packages/nocodb/src/models/View.ts b/packages/nocodb/src/models/View.ts index 20a17e64a4..141f54d162 100644 --- a/packages/nocodb/src/models/View.ts +++ b/packages/nocodb/src/models/View.ts @@ -41,6 +41,7 @@ import { } from '~/utils/modelUtils'; import { CustomUrl, LinkToAnotherRecordColumn } from '~/models'; import { cleanCommandPaletteCache } from '~/helpers/commandPaletteHelpers'; +import { isEE } from '~/utils'; const { v4: uuidv4 } = require('uuid'); @@ -1246,7 +1247,7 @@ export default class View implements ViewType { MetaTable.VIEWS, { uuid: null, - fk_custom_url_id: null, + ...(isEE ? { fk_custom_url_id: null } : {}), }, viewId, ); @@ -1255,7 +1256,7 @@ export default class View implements ViewType { await NocoCache.update(`${CacheScope.VIEW}:${viewId}`, { uuid: null, - fk_custom_url_id: null, + ...(isEE ? { fk_custom_url_id: null } : {}), }); } @@ -1286,7 +1287,7 @@ export default class View implements ViewType { 'password', 'meta', 'uuid', - 'fk_custom_url_id', + ...(isEE ? ['fk_custom_url_id'] : []), ...(includeCreatedByAndUpdateBy ? ['owned_by', 'created_by'] : []), ]); @@ -1419,7 +1420,7 @@ export default class View implements ViewType { // on update, delete any optimised single query cache await View.clearSingleQueryCache(context, view.fk_model_id, [view], ncMeta); - if (view.fk_custom_url_id) { + if (isEE && view.fk_custom_url_id) { CustomUrl.delete({ id: view.fk_custom_url_id as string }).catch(() => { logger.error(`Failed to delete custom urls of viewId: ${view.id}`); }); diff --git a/packages/nocodb/src/services/views.service.ts b/packages/nocodb/src/services/views.service.ts index 29dd1d79eb..0a1aea08e5 100644 --- a/packages/nocodb/src/services/views.service.ts +++ b/packages/nocodb/src/services/views.service.ts @@ -264,7 +264,7 @@ export class ViewsService { viewId: string; sharedView: SharedViewReqType & { custom_url_path?: string; - original_url?: string + original_url?: string; }; user: UserType; req: NcRequest;