Skip to content

Instantly share code, notes, and snippets.

@Nilanth

Nilanth/.jsx Secret

Created July 10, 2021 07:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nilanth/a15e1334bba54ba898129c8e4f1d38ec to your computer and use it in GitHub Desktop.
Save Nilanth/a15e1334bba54ba898129c8e4f1d38ec to your computer and use it in GitHub Desktop.
export function getRequest(URL) {
return axiosClient.get(`/${URL}`).then(response => response);
}
export function postRequest(URL, payload) {
return axiosClient.post(`/${URL}`, payload).then(response => response);
}
export function patchRequest(URL, payload) {
return axiosClient.patch(`/${URL}`, payload).then(response => response);
}
export function deleteRequest(URL) {
return axiosClient.delete(`/${URL}`).then(response => response);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment