Browse Source

fix(gui): construct project base metadata from public meta api response

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/4831/head
Pranav C 2 years ago
parent
commit
c54bfd435a
  1. 13
      packages/nc-gui/composables/useSharedFormViewStore.ts
  2. 2
      packages/nocodb-sdk/src/lib/Api.ts
  3. 3
      scripts/sdk/swagger.json

13
packages/nc-gui/composables/useSharedFormViewStore.ts

@ -43,7 +43,7 @@ const [useProvideSharedFormStore, useSharedFormStore] = useInjectionState((share
const { metas, setMeta } = useMetas()
const { loadProject } = useProject()
const { project } = useProject()
const { t } = useI18n()
@ -86,7 +86,16 @@ const [useProvideSharedFormStore, useSharedFormStore] = useInjectionState((share
await setMeta(viewMeta.model)
await loadProject(true, viewMeta.project_id)
// if project is not defined then set it with an object containing base
if (!project.value?.bases)
project.value = {
bases: [
{
id: viewMeta.base_id,
type: viewMeta.client,
},
],
}
const relatedMetas = { ...viewMeta.relatedMetas }

2
packages/nocodb-sdk/src/lib/Api.ts

@ -4004,6 +4004,7 @@ export class Api<
* @response `200` `(ViewType & {
relatedMetas?: any,
client?: string,
base_id?: string,
columns?: ((GridColumnType | FormColumnType | GalleryColumnType) & ColumnType),
model?: TableType,
@ -4017,6 +4018,7 @@ export class Api<
ViewType & {
relatedMetas?: any;
client?: string;
base_id?: string;
columns?: (GridColumnType | FormColumnType | GalleryColumnType) &
ColumnType;
model?: TableType;

3
scripts/sdk/swagger.json

@ -5529,6 +5529,9 @@
"client": {
"type": "string"
},
"base_id": {
"type": "string"
},
"columns": {
"allOf": [
{

Loading…
Cancel
Save