Skip to content

Commit 6316cdf

Browse files
feat: forward request context and headers to API handler
1 parent fd06183 commit 6316cdf

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/runtime/composables/$kirby.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export function $kirby<T = any>(
9191
body,
9292
}
9393

94-
const request = useRequestFetch(kql.client ? path : getProxyPath(key), {
94+
const request = useRequestFetch()(kql.client ? path : getProxyPath(key), {
9595
...fetchOptions,
9696
...(kql.client ? _clientFetchOptions : _serverFetchOptions),
9797
})

src/runtime/composables/$kql.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export function $kql<T extends KirbyQueryResponse<any, boolean> = KirbyQueryResp
6969
},
7070
}
7171

72-
const request = useRequestFetch(kql.client ? kql.prefix : getProxyPath(key), {
72+
const request = useRequestFetch()(kql.client ? kql.prefix : getProxyPath(key), {
7373
...fetchOptions,
7474
...(kql.client ? _clientFetchOptions : _serverFetchOptions),
7575
})

src/runtime/composables/useKirbyData.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export function useKirbyData<T = any>(
102102
let result: T | undefined
103103

104104
if (kql.client) {
105-
result = (await useRequestFetch<T>(_path.value, {
105+
result = (await useRequestFetch()<T>(_path.value, {
106106
...fetchOptions,
107107
signal: controller.signal,
108108
baseURL: kql.url,
@@ -116,7 +116,7 @@ export function useKirbyData<T = any>(
116116
})) as T
117117
}
118118
else {
119-
result = (await useRequestFetch<T>(getProxyPath(key.value), {
119+
result = (await useRequestFetch()<T>(getProxyPath(key.value), {
120120
...fetchOptions,
121121
signal: controller.signal,
122122
method: 'POST',

src/runtime/composables/useKql.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export function useKql<
8989
let result: ResT | undefined
9090

9191
if (kql.client) {
92-
result = (await useRequestFetch<ResT>(kql.prefix, {
92+
result = (await useRequestFetch()<ResT>(kql.prefix, {
9393
...fetchOptions,
9494
signal: controller.signal,
9595
baseURL: kql.url,
@@ -103,7 +103,7 @@ export function useKql<
103103
})) as ResT
104104
}
105105
else {
106-
result = (await useRequestFetch<ResT>(getProxyPath(key.value), {
106+
result = (await useRequestFetch()<ResT>(getProxyPath(key.value), {
107107
...fetchOptions,
108108
signal: controller.signal,
109109
method: 'POST',

0 commit comments

Comments
 (0)