request()

This commit is contained in:
Barxell 2023-10-18 10:45:31 +02:00
parent c994642e5a
commit f4c6bdada5

View File

@ -153,17 +153,15 @@ export default class VsInput extends Vue {
} }
private request(): void { private request(): void {
const openSearchUrl = 'https://your-search-engine.com/opensearch.xml'; const searchUrl = 'https://tethysbackend/opensearch.xml'; //i would guess ?
const searchTerms = this.display; const searchTerms = this.display;
const openSearchQueryUrl = openSearchUrl.replace('{searchTerms}', searchTerms); const searchQuery = searchUrl.replace('{searchTerms}', searchTerms);
fetch(openSearchQueryUrl) fetch(searchQuery)
.then((response) => response.text()) .then((response) => response.text())
.then((xml) => { .then((xml) => {
// Parse the OpenSearch XML response (you may need to use an XML parser library) // need XML parser library
const data = parseResponse(xml); // Implement a function to parse the XML response const data = parseResponse(xml);
// Handle the data (e.g., update your Vue component's state with the search results)
this.dataHandler(data); this.dataHandler(data);
}) })
.catch((error) => { .catch((error) => {