Browse Source

fix(nc-gui): custom url oss changes

Ramesh Mane 6 days 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',
'password',
'roles',
'fk_custom_url_id',
]);
// get existing cache

9
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}`);
});

2
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;

Loading…
Cancel
Save