()
| 1 | export const getFilms = async () => { |
| 2 | const res = await fetch('https://swapi.dev/api/films/') |
| 3 | return await res.json() |
| 4 | } |
| 5 | |
| 6 | export const getFilm = async (filmId: string) => { |
| 7 | const res = await fetch(`https://swapi.dev/api/films/${filmId}/`) |