Browse Source

fix: handle if ncSiteUrl is missing

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/1950/head
Pranav C 3 years ago
parent
commit
bef73c22fd
  1. 2
      packages/nc-gui/components/project/spreadsheet/components/codeSnippet.vue

2
packages/nc-gui/components/project/spreadsheet/components/codeSnippet.vue

@ -121,7 +121,7 @@ export default {
}
},
apiUrl() {
return new URL(`/api/v1/db/data/noco/${this.projectId}/${this.meta.title}/views/${this.view.title}`, this.$store.state.project.projectInfo.ncSiteUrl).href
return new URL(`/api/v1/db/data/noco/${this.projectId}/${this.meta.title}/views/${this.view.title}`, (this.$store.state.project.projectInfo && this.$store.state.project.projectInfo.ncSiteUrl) || '/').href
},
snippet() {
return new HTTPSnippet({

Loading…
Cancel
Save