mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-30 20:46:44 +00:00
chore: move nc-gui-v2 to nc-gui
This commit is contained in:
25
packages/nc-gui/utils/parsers/JSONUrlTemplateAdapter.ts
Normal file
25
packages/nc-gui/utils/parsers/JSONUrlTemplateAdapter.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import JSONTemplateAdapter from './JSONTemplateAdapter'
|
||||
import { useNuxtApp } from '#imports'
|
||||
|
||||
export default class JSONUrlTemplateAdapter extends JSONTemplateAdapter {
|
||||
url: string
|
||||
$api: any
|
||||
|
||||
constructor(url: string, parserConfig: Record<string, any>) {
|
||||
const { $api } = useNuxtApp()
|
||||
const name = url.split('/').pop()
|
||||
super(name, parserConfig)
|
||||
this.url = url
|
||||
this.$api = $api
|
||||
}
|
||||
|
||||
async init() {
|
||||
const data = await this.$api.utils.axiosRequestMake({
|
||||
apiMeta: {
|
||||
url: this.url,
|
||||
},
|
||||
})
|
||||
this._jsonData = data
|
||||
await super.init()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user