import { Options, Vue } from 'vue-class-component'; @Options({}) export default class APIExtendableLanguage extends Vue { isLoading = true; images: any; language = ''; languages: any; random: any; private baseUrl = 'https://senpy-club-api-worker.fuwn.workers.dev/v2'; async fetchImages(): Promise { fetch(`${this.baseUrl}/language/${this.language}`, { method: 'GET', mode: 'no-cors', }) .then((response) => response.json()) .then((response) => { this.images = response; this.isLoading = false; }); } async fetchLanguages(): Promise { fetch(`${this.baseUrl}/languages`, { method: 'GET', mode: 'no-cors', }) .then((response) => response.json()) .then((response) => { this.languages = response; this.isLoading = false; }); } async fetchRandom(): Promise { fetch(`${this.baseUrl}/random`, { method: 'GET', mode: 'no-cors', }) .then((response) => response.json()) .then((response) => { this.random = response; this.isLoading = false; }); } }