Skip to content

Commit bc473c2

Browse files
committed
refactor: use path if name doesn't exist
1 parent 05c7791 commit bc473c2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/ApiExplorer.astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,8 @@ import { Aside, Icon } from '@astrojs/starlight/components'
241241
if (status === 200) {
242242
const jsonData = await response.json()
243243
ditto = JSON.stringify(jsonData)
244-
const title = `Resource for ${jsonData.name}`
244+
const titleName = jsonData.name || pokeApiPath
245+
const title = `Resource for ${titleName}`
245246
pokeapiDirectLink.innerHTML = url
246247
pokeapiDirectLink.href = url
247248

0 commit comments

Comments
 (0)