initial
This commit is contained in:
17
apps/pay/composables/api.ts
Normal file
17
apps/pay/composables/api.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import type { NitroFetchRequest } from 'nitropack'
|
||||
|
||||
export function $api<
|
||||
T = unknown,
|
||||
R extends NitroFetchRequest = NitroFetchRequest,
|
||||
>(
|
||||
request: Parameters<typeof $fetch<T, R>>[0],
|
||||
options?: Partial<Parameters<typeof $fetch<T, R>>[1]>,
|
||||
) {
|
||||
const runtimeConfig = useRuntimeConfig()
|
||||
|
||||
return $fetch<T, R>(request, {
|
||||
...options,
|
||||
retry: false,
|
||||
baseURL: runtimeConfig.public.apiHost as string,
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user