fix: use $fetch over fetch
This commit is contained in:
parent
7098dda6b4
commit
2c4489917a
1 changed files with 3 additions and 6 deletions
|
@ -60,14 +60,11 @@ function changeTheme(id: string, url: string) {
|
||||||
|
|
||||||
const fetchThemes = async () => {
|
const fetchThemes = async () => {
|
||||||
for (const theme of defaultThemes) {
|
for (const theme of defaultThemes) {
|
||||||
const themeConfig = await fetch(`${baseURL}themes/${theme}.json`)
|
const themeConfig = await $fetch(`${baseURL}themes/${theme}.json`) as Theme
|
||||||
const themeConfigJson = await themeConfig.json() as Theme
|
themeConfig.id = theme
|
||||||
themeConfigJson.id = theme
|
|
||||||
|
|
||||||
themes.push(themeConfigJson)
|
themes.push(themeConfig)
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(themes)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await fetchThemes()
|
await fetchThemes()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue