Browse Source

fix: correct api sample template strings

pull/4418/head
Daniel Spaude 2 years ago
parent
commit
d4ebad43c9
No known key found for this signature in database
GPG Key ID: 654A3D1FA4F35FFE
  1. 4
      packages/nc-gui/components/smartsheet/ApiSnippet.vue

4
packages/nc-gui/components/smartsheet/ApiSnippet.vue

@ -103,9 +103,9 @@ const activeLang = $computed(() => langs.find((lang) => lang.name === selectedLa
const code = $computed(() => { const code = $computed(() => {
if (activeLang?.name === 'nocodb-sdk') { if (activeLang?.name === 'nocodb-sdk') {
return `${selectedClient === 'node' ? 'const { Api } require("nocodb-sdk");' : 'import { Api } from "nocodb-sdk";'} return `${selectedClient === 'node' ? 'const { Api } = require("nocodb-sdk");' : 'import { Api } from "nocodb-sdk";'}
const api = new Api({ const api = new Api({
baseURL: ${JSON.stringify(apiUrl)}, baseURL: "${(appInfo && appInfo.ncSiteUrl) || '/'}",
headers: { headers: {
"xc-auth": ${JSON.stringify(token as string)} "xc-auth": ${JSON.stringify(token as string)}
} }

Loading…
Cancel
Save