import config from "./config.json"; import { userApiSchema, placeApiSchema } from "./types"; const users: { batch?: (ids: string[]) => Promise> } = {}; const places: { batch?: (ids: string[]) => Promise> } = {}; users.batch = async (ids: string[]): Promise> => { const res: Record = {}; for (let id of ids) { const info = await (await fetch(config.api.url + '/users/' + id)).json(); res[id] = info; } return res; }; places.batch = async (ids: string[]): Promise> => { const res: Record = {}; for (let id of ids) { const info = await (await fetch(config.api.url + '/places/' + id)).json(); res[id] = info; } return res; }; export default { users: users, places: places };