Skip to content

Commit 456b439

Browse files
committed
fix: medusaRequest types
1 parent dce3399 commit 456b439

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/lib/medusa-fetch/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ const ENDPOINT =
66
export default async function medusaRequest(
77
method: string,
88
path = "",
9-
payload?: Record<string, any> | undefined
9+
payload?: {
10+
query?: Record<string, any>
11+
body?: Record<string, any>
12+
}
1013
) {
1114
const options: RequestInit = {
1215
method,
@@ -22,7 +25,7 @@ export default async function medusaRequest(
2225
options.body = JSON.stringify(payload.body)
2326
}
2427
if ("query" in payload) {
25-
const params = objectToURLSearchParams(payload.query).toString()
28+
const params = objectToURLSearchParams(payload.query!).toString()
2629
path = `${path}?${params}`
2730
}
2831
}

0 commit comments

Comments
 (0)