Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
shahdivyank committed Sep 2, 2024
1 parent bef704f commit 01740db
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions utils/api.ts → hooks/useFetch.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
type API = {
interface API {
url: string;
method: "GET" | "POST" | "PUT" | "DELETE";
body?: {};
};
}

export const api = async ({ url, method, body }: API) => {
export const useFetch = async ({ url, method, body }: API) => {
const response = await fetch(url, {
method: method,
body: JSON.stringify(body),
Expand Down

0 comments on commit 01740db

Please sign in to comment.