mirror of https://github.com/nocodb/nocodb
Wing-Kam Wong
2 years ago
1 changed files with 21 additions and 0 deletions
@ -0,0 +1,21 @@
|
||||
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() |
||||
} |
||||
} |
Loading…
Reference in new issue