Browse Source

Merge pull request #4418 from humannocode/correct-api-samples-for-sdk-variant

fix: correct api sample template strings
pull/4441/head
աɨռɢӄաօռɢ 2 years ago committed by GitHub
parent
commit
43b62fe591
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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(() => {
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({
baseURL: ${JSON.stringify(apiUrl)},
baseURL: "${(appInfo && appInfo.ncSiteUrl) || '/'}",
headers: {
"xc-auth": ${JSON.stringify(token as string)}
}

Loading…
Cancel
Save