Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

fix: add source required properties in public view meta

Ramesh Manec207d2883851
diff --git a/packages/nc-gui/composables/useSharedView.ts b/packages/nc-gui/composables/useSharedView.ts
index 7dce301c60..3374a22b21 100644
--- a/packages/nc-gui/composables/useSharedView.ts
+++ b/packages/nc-gui/composables/useSharedView.ts
@@ -132,6 +132,7 @@ export function useSharedView() {
{
id: viewMeta.source_id,
type: viewMeta.client,
+ ...(viewMeta.source || {}),
},
],
})
diff --git a/packages/nocodb/src/services/public-metas.service.ts b/packages/nocodb/src/services/public-metas.service.ts
index 8ca4750b3a..a3d371822c 100644
--- a/packages/nocodb/src/services/public-metas.service.ts
+++ b/packages/nocodb/src/services/public-metas.service.ts
@@ -1,5 +1,6 @@
import { Injectable } from '@nestjs/common';
import {
+ BoolType,
isCreatedOrLastModifiedByCol,
isLinksOrLTAR,
ncIsObject,
@@ -37,6 +38,7 @@ export class PublicMetasService {
relatedMetas?: { [ket: string]: Model };
users?: { id: string; display_name: string; email: string }[];
client?: string;
+ source?: Pick<Source, 'id' | 'type' | 'is_meta' | 'is_local'>;
} = await View.getByUUID(context, param.sharedViewUuid);
if (!view) NcError.viewNotFound(param.sharedViewUuid);
@@ -61,6 +63,12 @@ export class PublicMetasService {
const source = await Source.get(context, view.model.source_id);
view.client = source.type;
+ view.source = {
+ id: source.id,
+ type: source.type,
+ is_meta: source.is_meta,
+ is_local: source.is_local,
+ };
// todo: return only required props
view.password = undefined;