Files
nocodb/packages/nc-gui/helpers/parsers/JSONUrlTemplateAdapter.ts
Mert E 89f0895de3 fix: experimental frontend optimizations (#8427)
* fix: get rid of barrel files

* chore: get rid of explicit imports

* fix: use explicit import for classes and enums

* fix: use explicit import for enum & class & aliases

* fix: build issues
2024-05-08 15:55:09 +05:30

26 lines
673 B
TypeScript

import type { Api } from 'nocodb-sdk'
import JSONTemplateAdapter from './JSONTemplateAdapter'
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()
}
}