mirror of
https://github.com/Nezumi-2711/react-training.git
synced 2026-09-22 20:01:59 +00:00
Fix bug and optimzed code
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user