Browse Source

geodata: fix map shared view

pull/4749/head
flisowna 2 years ago
parent
commit
9904169531
  1. 6
      packages/nc-gui/composables/useMapViewDataStore.ts
  2. 3
      packages/nocodb/src/lib/meta/api/publicApis/publicDataApis.ts

6
packages/nc-gui/composables/useMapViewDataStore.ts

@ -17,6 +17,7 @@ const [useProvideMapViewStore, useMapViewStore] = useInjectionState(
(
meta: Ref<TableType | undefined>,
viewMeta: Ref<ViewType | MapType | undefined> | ComputedRef<(ViewType & { id: string }) | undefined>,
shared = false,
where?: ComputedRef<string | undefined>,
) => {
if (!meta) {
@ -33,7 +34,7 @@ const [useProvideMapViewStore, useMapViewStore] = useInjectionState(
const { isUIAllowed } = useUIPermission()
const isPublic = inject(IsPublicInj, ref(false))
const isPublic = ref(shared) || inject(IsPublicInj, ref(false))
const { sorts, nestedFilters } = useSmartsheetStoreOrThrow()
@ -72,7 +73,8 @@ const [useProvideMapViewStore, useMapViewStore] = useInjectionState(
}
async function loadMapData() {
if ((!project?.value?.id || !meta.value?.id || !viewMeta.value?.id) && !isPublic.value) return
if ((!project?.value?.id || !meta.value?.id || !viewMeta.value?.id) && !isPublic?.value) return
const res = !isPublic.value
? await api.dbViewRow.list('noco', project.value.id!, meta.value!.id!, viewMeta.value!.id!, {

3
packages/nocodb/src/lib/meta/api/publicApis/publicDataApis.ts

@ -28,7 +28,8 @@ export async function dataList(req: Request, res: Response) {
if (
view.type !== ViewTypes.GRID &&
view.type !== ViewTypes.KANBAN &&
view.type !== ViewTypes.GALLERY
view.type !== ViewTypes.GALLERY &&
view.type !== ViewTypes.MAP
) {
NcError.notFound('Not found');
}

Loading…
Cancel
Save