Fix bug and optimzed code

This commit is contained in:
2023-11-06 11:27:29 +07:00
parent 96d1e6038c
commit 7bfc2bcfa4
32 changed files with 285 additions and 224 deletions
+2 -2
View File
@@ -2,7 +2,7 @@
import { BASE_URL } from '../constants/path';
// Types
import { TResponse } from '../types/response';
import { IResponse } from '../types/responses';
type TMethodRequest = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
@@ -17,7 +17,7 @@ export const sendRequest = async <T>(
path: string,
method: TMethodRequest = 'GET',
body?: BodyInit
): Promise<TResponse<T>> => {
): Promise<IResponse<T>> => {
const response = await fetch(BASE_URL + path, {
method,
body,