initial commit
This commit is contained in:
11
app/repositories/factory.ts
Normal file
11
app/repositories/factory.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import type { $Fetch, SearchParameters } from 'ofetch';
|
||||
|
||||
export async function fetchWithRepo<T>(
|
||||
fetcher: $Fetch,
|
||||
url: string,
|
||||
method: 'GET' | 'POST' | 'PUT' | 'DELETE' = 'GET',
|
||||
body?: any,
|
||||
params?: SearchParameters
|
||||
): Promise<T> {
|
||||
return await fetcher(url, { method, body, params });
|
||||
}
|
||||
Reference in New Issue
Block a user