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 () => {
|
||||
for (const theme of defaultThemes) {
|
||||
const themeConfig = await fetch(`${baseURL}themes/${theme}.json`)
|
||||
const themeConfigJson = await themeConfig.json() as Theme
|
||||
themeConfigJson.id = theme
|
||||
const themeConfig = await $fetch(`${baseURL}themes/${theme}.json`) as Theme
|
||||
themeConfig.id = theme
|
||||
|
||||
themes.push(themeConfigJson)
|
||||
themes.push(themeConfig)
|
||||
}
|
||||
|
||||
console.log(themes)
|
||||
}
|
||||
|
||||
await fetchThemes()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue