Browse Source

Merge pull request #4855 from nocodb/fix/gallery-cover-image-share-view

fix(nc-gui): get public gallery data from sharedView.view
pull/4870/head
navi 2 years ago committed by GitHub
parent
commit
8a79feb00d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      packages/nc-gui/composables/useViewData.ts

10
packages/nc-gui/composables/useViewData.ts

@ -49,7 +49,9 @@ export function useViewData(
const { getMeta } = useMetas() const { getMeta } = useMetas()
const appInfoDefaultLimit = appInfo.defaultLimit || 25 const appInfoDefaultLimit = appInfo.defaultLimit || 25
const _paginationData = ref<PaginatedType>({ page: 1, pageSize: appInfoDefaultLimit }) const _paginationData = ref<PaginatedType>({ page: 1, pageSize: appInfoDefaultLimit })
const aggCommentCount = ref<{ row_id: string; count: number }[]>([]) const aggCommentCount = ref<{ row_id: string; count: number }[]>([])
const galleryData = ref<GalleryType>() const galleryData = ref<GalleryType>()
@ -64,7 +66,7 @@ export function useViewData(
const { project, isSharedBase } = useProject() const { project, isSharedBase } = useProject()
const { fetchSharedViewData, paginationData: sharedPaginationData } = useSharedView() const { sharedView, fetchSharedViewData, paginationData: sharedPaginationData } = useSharedView()
const { $api, $e } = useNuxtApp() const { $api, $e } = useNuxtApp()
@ -203,8 +205,10 @@ export function useViewData(
} }
async function loadGalleryData() { async function loadGalleryData() {
if (!viewMeta?.value?.id || isPublic.value) return if (!viewMeta?.value?.id) return
galleryData.value = await $api.dbView.galleryRead(viewMeta.value.id) galleryData.value = isPublic.value
? (sharedView.value?.view as GalleryType)
: await $api.dbView.galleryRead(viewMeta.value.id)
} }
async function insertRow( async function insertRow(

Loading…
Cancel
Save