Refactor API requests and update component structure
This commit is contained in:
@ -44,6 +44,7 @@ const useClientRequest = async <T = unknown>(
|
||||
config?: Omit<FetchOptions, 'method'>
|
||||
): Promise<T> => {
|
||||
return useClientRequest<T>(endpoint, { ...config, method: 'GET' })
|
||||
|
||||
}
|
||||
|
||||
// POST请求
|
||||
@ -71,4 +72,4 @@ const useClientRequest = async <T = unknown>(
|
||||
config?: Omit<FetchOptions, 'method' | 'body'>
|
||||
): Promise<T> => {
|
||||
return useClientRequest<T>(endpoint, { ...config, method: 'PUT', body })
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user