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
542 B
22 lines
542 B
2 years ago
|
import JSONTemplateAdapter from '~/components/import/templateParsers/JSONTemplateAdapter'
|
||
2 years ago
|
|
||
2 years ago
|
export default class JSONUrlTemplateAdapter extends JSONTemplateAdapter {
|
||
2 years ago
|
constructor(url, $store, parserConfig, $api) {
|
||
|
const name = url.split('/').pop()
|
||
|
super(name, null, parserConfig)
|
||
|
this.url = url
|
||
|
this.$api = $api
|
||
|
this.$store = $store
|
||
|
}
|
||
|
|
||
|
async init() {
|
||
|
const data = await this.$api.utils.axiosRequestMake({
|
||
|
apiMeta: {
|
||
2 years ago
|
url: this.url
|
||
2 years ago
|
}
|
||
|
})
|
||
2 years ago
|
this._jsonData = data
|
||
2 years ago
|
await super.init()
|
||
|
}
|
||
|
}
|