import {API} from "./Constants"; export function fetchAPI(url: string, payload: object, method = "POST"): Promise { return fetch(`${API}/${url}`, { method, headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' }, body: JSON.stringify(payload) }) }