File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -243,10 +243,10 @@ It's also possible to create extended version of existing by providing additiona
243
243
const posts = api .extend ({ resource: ' /posts' })
244
244
245
245
await posts .get ().json () // β [{ id: 0, title: 'Hello' }, ...]
246
- await posts .get (0 ).json () // β { id: 0, title: 'Hello' }
246
+ await posts .get (' /1 ' ).json () // β { id: 0, title: 'Hello' }
247
247
await posts .post ({ json: { title: ' Bye' } }).json () // β { id: 1, title: 'Bye' }
248
- await posts .patch (0 , { json: { title: ' Hey' } }).json () // β { id: 0, title: 'Hey' }
249
- await posts .delete (1 ).void () // β undefined
248
+ await posts .patch (' /0 ' , { json: { title: ' Hey' } }).json () // β { id: 0, title: 'Hey' }
249
+ await posts .delete (' /1 ' ).void () // β undefined
250
250
```
251
251
252
252
#### Related
@@ -385,7 +385,7 @@ const extended = instance.extend({
385
385
})
386
386
387
387
// will send request to: 'https://jsonplaceholder.typicode.com/posts/1'
388
- await extended.post(1 , { json: { title: 'Hello' } })
388
+ await extended.post('/1' , { json: { title: 'Hello' } })
389
389
` ` `
390
390
391
391
##### Related
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ interface Serialize {
28
28
29
29
interface RequestMethod < P extends Payload > {
30
30
< T extends P > (
31
- resource ?: number | string | RequestMethodOptions < T > ,
31
+ resource ?: string | RequestMethodOptions < T > ,
32
32
options ?: RequestMethodOptions < T >
33
33
) : ResponsePromise < T >
34
34
}
You canβt perform that action at this time.
0 commit comments