From b0cad5fa8e9dbabbd7604700554b5ace5799a9a5 Mon Sep 17 00:00:00 2001 From: Daniel Spaude Date: Mon, 13 Mar 2023 12:22:06 +0100 Subject: [PATCH] shared map view issue debugging - WIP --- packages/nc-gui/composables/useMapViewDataStore.ts | 5 +++-- packages/nc-gui/composables/useViewData.ts | 2 ++ .../src/lib/controllers/publicControllers/publicMeta.ctl.ts | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/composables/useMapViewDataStore.ts b/packages/nc-gui/composables/useMapViewDataStore.ts index 1ac4a6ecba..afb883b325 100644 --- a/packages/nc-gui/composables/useMapViewDataStore.ts +++ b/packages/nc-gui/composables/useMapViewDataStore.ts @@ -33,7 +33,7 @@ const [useProvideMapViewStore, useMapViewStore] = useInjectionState( const formattedData = ref([]) - const { api } = useApi() + // const { api } = useApi() const { project } = useProject() @@ -71,8 +71,9 @@ const [useProvideMapViewStore, useMapViewStore] = useInjectionState( } async function loadMapMeta() { + alert('loadMapData') if (!viewMeta?.value?.id || !meta?.value?.columns) return - mapMetaData.value = await $api.dbView.mapRead(viewMeta.value.id) + // mapMetaData.value = await $api.dbView.mapRead(viewMeta.value.id) geoDataFieldColumn.value = (meta.value.columns as ColumnType[]).filter((f) => f.id === mapMetaData.value.fk_geo_data_col_id)[0] || {} } diff --git a/packages/nc-gui/composables/useViewData.ts b/packages/nc-gui/composables/useViewData.ts index cd2ba8dde9..7b699c6e9c 100644 --- a/packages/nc-gui/composables/useViewData.ts +++ b/packages/nc-gui/composables/useViewData.ts @@ -187,6 +187,7 @@ export function useViewData( } async function loadData(params: Parameters['dbViewRow']['list']>[4] = {}) { + debugger if ((!project?.value?.id || !meta.value?.id || !viewMeta.value?.id) && !isPublic.value) return const response = !isPublic.value ? await api.dbViewRow.list('noco', project.value.id!, meta.value!.id!, viewMeta.value!.id!, { @@ -217,6 +218,7 @@ export function useViewData( galleryData.value = isPublic.value ? (sharedView.value?.view as GalleryType) : await $api.dbView.galleryRead(viewMeta.value.id) + // debugger } async function insertRow( diff --git a/packages/nocodb/src/lib/controllers/publicControllers/publicMeta.ctl.ts b/packages/nocodb/src/lib/controllers/publicControllers/publicMeta.ctl.ts index 3517527884..680107b06c 100644 --- a/packages/nocodb/src/lib/controllers/publicControllers/publicMeta.ctl.ts +++ b/packages/nocodb/src/lib/controllers/publicControllers/publicMeta.ctl.ts @@ -4,6 +4,7 @@ import { publicMetaService } from '../../services'; import type { Request, Response } from 'express'; export async function viewMetaGet(req: Request, res: Response) { + console.log('FOO viewMetaGet'); res.json( await publicMetaService.viewMetaGet({ password: req.headers?.['xc-password'] as string,