(limit: number)
| 1 | import type { Post } from './types' |
| 2 | |
| 3 | export const getPosts = async (limit: number) => { |
| 4 | const response = await fetch('https://jsonplaceholder.typicode.com/posts') |
| 5 | const data = (await response.json()) as Array<Post> |
| 6 | return data.filter((x) => x.id <= limit) |
| 7 | } |
| 8 | |
| 9 | export const getPostById = async (id: number): Promise<Post> => { |
| 10 | const response = await fetch( |
nothing calls this directly
no outgoing calls
no test coverage detected