Browse Source

fix(nc-gui): custom url oss changes

Ramesh Mane 1 week ago
parent
commit
af684ae79d
  1. 1
      packages/nocodb/src/models/Base.ts
  2. 9
      packages/nocodb/src/models/View.ts
  3. 2
      packages/nocodb/src/services/views.service.ts

1
packages/nocodb/src/models/Base.ts

@ -345,7 +345,6 @@ export default class Base implements BaseType {
'uuid', 'uuid',
'password', 'password',
'roles', 'roles',
'fk_custom_url_id',
]); ]);
// get existing cache // get existing cache

9
packages/nocodb/src/models/View.ts

@ -41,6 +41,7 @@ import {
} from '~/utils/modelUtils'; } from '~/utils/modelUtils';
import { CustomUrl, LinkToAnotherRecordColumn } from '~/models'; import { CustomUrl, LinkToAnotherRecordColumn } from '~/models';
import { cleanCommandPaletteCache } from '~/helpers/commandPaletteHelpers'; import { cleanCommandPaletteCache } from '~/helpers/commandPaletteHelpers';
import { isEE } from '~/utils';
const { v4: uuidv4 } = require('uuid'); const { v4: uuidv4 } = require('uuid');
@ -1246,7 +1247,7 @@ export default class View implements ViewType {
MetaTable.VIEWS, MetaTable.VIEWS,
{ {
uuid: null, uuid: null,
fk_custom_url_id: null, ...(isEE ? { fk_custom_url_id: null } : {}),
}, },
viewId, viewId,
); );
@ -1255,7 +1256,7 @@ export default class View implements ViewType {
await NocoCache.update(`${CacheScope.VIEW}:${viewId}`, { await NocoCache.update(`${CacheScope.VIEW}:${viewId}`, {
uuid: null, uuid: null,
fk_custom_url_id: null, ...(isEE ? { fk_custom_url_id: null } : {}),
}); });
} }
@ -1286,7 +1287,7 @@ export default class View implements ViewType {
'password', 'password',
'meta', 'meta',
'uuid', 'uuid',
'fk_custom_url_id', ...(isEE ? ['fk_custom_url_id'] : []),
...(includeCreatedByAndUpdateBy ? ['owned_by', 'created_by'] : []), ...(includeCreatedByAndUpdateBy ? ['owned_by', 'created_by'] : []),
]); ]);
@ -1419,7 +1420,7 @@ export default class View implements ViewType {
// on update, delete any optimised single query cache // on update, delete any optimised single query cache
await View.clearSingleQueryCache(context, view.fk_model_id, [view], ncMeta); 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(() => { CustomUrl.delete({ id: view.fk_custom_url_id as string }).catch(() => {
logger.error(`Failed to delete custom urls of viewId: ${view.id}`); logger.error(`Failed to delete custom urls of viewId: ${view.id}`);
}); });

2
packages/nocodb/src/services/views.service.ts

@ -264,7 +264,7 @@ export class ViewsService {
viewId: string; viewId: string;
sharedView: SharedViewReqType & { sharedView: SharedViewReqType & {
custom_url_path?: string; custom_url_path?: string;
original_url?: string original_url?: string;
}; };
user: UserType; user: UserType;
req: NcRequest; req: NcRequest;

Loading…
Cancel
Save