Browse Source

fix: url correction

nc-feat/amplify
Pranav C 1 year ago
parent
commit
ed7b0ebd97
  1. 12
      packages/nc-gui/components/dlg/share-and-collaborate/ShareBase.vue
  2. 6
      packages/nocodb/src/services/shared-bases.service.ts

12
packages/nc-gui/components/dlg/share-and-collaborate/ShareBase.vue

@ -1,5 +1,5 @@
<script setup lang="ts">
import { extractSdkResponseErrorMsg, message, onMounted, storeToRefs, useBase, useDashboard, useNuxtApp } from '#imports'
import { extractSdkResponseErrorMsg, message, onMounted, storeToRefs, useBase, useDashboard, useNuxtApp, useWorkspace, useGlobal } from '#imports'
interface ShareBase {
uuid?: string
@ -20,9 +20,13 @@ const sharedBase = ref<null | ShareBase>(null)
const { base } = storeToRefs(useBase())
const url = computed(() =>
sharedBase.value && sharedBase.value.uuid ? `${dashboardUrl.value}#/base/${sharedBase.value.uuid}` : '',
)
const { getBaseUrl, appInfo } = useGlobal()
const workspaceStore = useWorkspace()
const url = computed(() => sharedBase.value && sharedBase.value.uuid ? encodeURI(
`${getBaseUrl(workspaceStore.activeWorkspaceId)}${appInfo.value?.dashboardPath}#/base/${sharedBase.value.uuid}`,
) : '')
const loadBase = async () => {
try {

6
packages/nocodb/src/services/shared-bases.service.ts

@ -47,7 +47,11 @@ export class SharedBasesService {
await Base.update(base.id, data);
data.url = `${param.siteUrl}${config.dashboardPath}#/nc/base/${data.uuid}`;
data.url = this.getUrl({
base,
siteUrl: param.siteUrl,
});
delete data.password;
this.appHooksService.emit(AppEvents.SHARED_BASE_GENERATE_LINK, {

Loading…
Cancel
Save