Skip to content

Commit

Permalink
refactor: switched from promises to await in KOwsServiceField
Browse files Browse the repository at this point in the history
  • Loading branch information
claustres committed Jun 6, 2024
1 parent 2cd885f commit 23a04fb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions map/client/components/form/KOwsServiceField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,9 @@ export default {
// fetch content and try to convert to json
const query = url.href
caps = await fetch(query, { redirect: 'follow' })
.then(resp => resp.text())
.then(txt => xml2js.parseStringPromise(txt, { tagNameProcessors: [xml2js.processors.stripPrefix] }))
const resp = await fetch(query, { redirect: 'follow' })
const txt = await resp.text()
caps = await xml2js.parseStringPromise(txt, { tagNameProcessors: [xml2js.processors.stripPrefix] })
// look for SERVICE=xxx
const protocol = this.findQueryParameter(url.searchParams, 'SERVICE')
if (protocol === 'WMS') result.protocol = 'WMS'
Expand Down

0 comments on commit 23a04fb

Please sign in to comment.