mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
512 B
22 lines
512 B
2 years ago
|
import JSONTemplateAdapter from './JSONTemplateAdapter'
|
||
|
const { $api } = useNuxtApp()
|
||
|
|
||
|
export default class JSONUrlTemplateAdapter extends JSONTemplateAdapter {
|
||
|
url: string
|
||
|
constructor(url: string, parserConfig: Record<string, any>) {
|
||
|
const name = url.split('/').pop()
|
||
|
super(name, parserConfig)
|
||
|
this.url = url
|
||
|
}
|
||
|
|
||
|
async init() {
|
||
|
const data = await $api.utils.axiosRequestMake({
|
||
|
apiMeta: {
|
||
|
url: this.url,
|
||
|
},
|
||
|
})
|
||
|
this._jsonData = data
|
||
|
await super.init()
|
||
|
}
|
||
|
}
|