(characterId: string)
| 14 | } |
| 15 | |
| 16 | export const getCharacter = async (characterId: string) => { |
| 17 | const res = await fetch(`https://swapi.dev/api/people/${characterId}/`) |
| 18 | return await res.json() |
| 19 | } |
| 20 | |
| 21 | export const getPlanet = async (planetId: string) => { |
| 22 | const res = await fetch(`https://swapi.dev/api/planets/${planetId}/`) |