We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dce3399 commit 456b439Copy full SHA for 456b439
src/lib/medusa-fetch/index.ts
@@ -6,7 +6,10 @@ const ENDPOINT =
6
export default async function medusaRequest(
7
method: string,
8
path = "",
9
- payload?: Record<string, any> | undefined
+ payload?: {
10
+ query?: Record<string, any>
11
+ body?: Record<string, any>
12
+ }
13
) {
14
const options: RequestInit = {
15
method,
@@ -22,7 +25,7 @@ export default async function medusaRequest(
22
25
options.body = JSON.stringify(payload.body)
23
26
}
24
27
if ("query" in payload) {
- const params = objectToURLSearchParams(payload.query).toString()
28
+ const params = objectToURLSearchParams(payload.query!).toString()
29
path = `${path}?${params}`
30
31
0 commit comments