You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
import {API} from "./Constants";
|
|
|
|
|
|
export function fetchAPI(url: string, payload: object, method = "POST"): Promise<Response> {
|
|
return fetch(`${API}/${url}`, {
|
|
method,
|
|
headers: {
|
|
'Accept': 'application/json',
|
|
'Content-Type': 'application/json'
|
|
},
|
|
body: JSON.stringify(payload)
|
|
})
|
|
}
|