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.
26 lines
710 B
26 lines
710 B
import type { Api } from 'nocodb-sdk' |
|
import JSONTemplateAdapter from './JSONTemplateAdapter' |
|
// import { useNuxtApp } from '#app' |
|
|
|
export default class JSONUrlTemplateAdapter extends JSONTemplateAdapter { |
|
url: string |
|
$api: any |
|
|
|
constructor(url: string, parserConfig: Record<string, any>, api: Api<any>, progressCallback?: (msg: string) => void) { |
|
// const { $api } = useNuxtApp() |
|
super({}, parserConfig, progressCallback) |
|
this.url = url |
|
this.$api = api |
|
} |
|
|
|
async init() { |
|
this.progress('Downloading json file') |
|
const data = await this.$api.utils.axiosRequestMake({ |
|
apiMeta: { |
|
url: this.url, |
|
}, |
|
}) |
|
this._jsonData = data |
|
await super.init() |
|
} |
|
}
|
|
|