Skip to content
Source
Sign inSign up
TanStack/bling

fixing the GET method option on the server$ utility #13

OpenZackDeRose(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/13/headopened

Showing 3 changed files with 15 additions and 9 deletions.

x
0 of 3 viewed, 3 left
4 additions and 0 deletionspackages/bling/src/utils/utils.tsModified
View file
@@ -267,6 +267,10 @@
? `${pathname}?payload=${encodeURIComponent(payloadInit.body as string)}`
: pathname
​
+ if (method.toLocaleLowerCase() === 'get') {
+ delete payloadInit.body
+ }
+​
return new URL(
resolved,
typeof document !== 'undefined' ? window.location.href : `http://localhost`,
1 addition and 1 deletionpackages/bling/src/types.tsModified
View file
@@ -21,7 +21,7 @@
​
export type CreateFetcherFn = <T extends AnyFetchFn>(
fn: T,
- opts?: FetchFnCtxWithRequest,
+ opts?: FetchFnCtxWithRequest | FetchFnCtxOptions,
) => Fetcher<T>
​
export type FetcherFn<T extends AnyFetchFn> = (
10 additions and 8 deletionsREADME.mdModified
View file
@@ -127,13 +127,13 @@
```tsx