Commit 98ee918
committed
Add cache option to fetch
Fixes #809
Add support for the `cache` option in the Next Drupal client.
* Add `cache` option to `JsonApiWithNextFetchOptions` type in `packages/next-drupal/src/types/options.ts`.
* Update `fetch` method in `packages/next-drupal/src/next-drupal.ts` to pass the `cache` option as part of the `init` object if provided.
* Add tests for the `cache` option in `fetch` and `getResource` methods in `packages/next-drupal/tests/NextDrupalBase/fetch-methods.test.ts` and `packages/next-drupal/tests/NextDrupal/resource-methods.test.ts`.
---
For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/chapter-three/next-drupal/issues/809?shareId=XXXX-XXXX-XXXX-XXXX).1 parent a50598c commit 98ee918
File tree
4 files changed
+58
-0
lines changed- packages/next-drupal
- src
- types
- tests
- NextDrupalBase
- NextDrupal
4 files changed
+58
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
118 | 119 | | |
119 | 120 | | |
120 | 121 | | |
| |||
158 | 159 | | |
159 | 160 | | |
160 | 161 | | |
| 162 | + | |
161 | 163 | | |
162 | 164 | | |
163 | 165 | | |
| |||
202 | 204 | | |
203 | 205 | | |
204 | 206 | | |
| 207 | + | |
205 | 208 | | |
206 | 209 | | |
207 | 210 | | |
| |||
239 | 242 | | |
240 | 243 | | |
241 | 244 | | |
| 245 | + | |
242 | 246 | | |
243 | 247 | | |
244 | 248 | | |
| |||
287 | 291 | | |
288 | 292 | | |
289 | 293 | | |
| 294 | + | |
290 | 295 | | |
291 | 296 | | |
292 | 297 | | |
| |||
376 | 381 | | |
377 | 382 | | |
378 | 383 | | |
| 384 | + | |
379 | 385 | | |
380 | 386 | | |
381 | 387 | | |
| |||
435 | 441 | | |
436 | 442 | | |
437 | 443 | | |
| 444 | + | |
438 | 445 | | |
439 | 446 | | |
440 | 447 | | |
| |||
500 | 507 | | |
501 | 508 | | |
502 | 509 | | |
| 510 | + | |
503 | 511 | | |
504 | 512 | | |
505 | 513 | | |
| |||
573 | 581 | | |
574 | 582 | | |
575 | 583 | | |
| 584 | + | |
576 | 585 | | |
577 | 586 | | |
578 | 587 | | |
| |||
600 | 609 | | |
601 | 610 | | |
602 | 611 | | |
| 612 | + | |
603 | 613 | | |
604 | 614 | | |
605 | 615 | | |
| |||
710 | 720 | | |
711 | 721 | | |
712 | 722 | | |
| 723 | + | |
713 | 724 | | |
714 | 725 | | |
715 | 726 | | |
| |||
760 | 771 | | |
761 | 772 | | |
762 | 773 | | |
| 774 | + | |
763 | 775 | | |
764 | 776 | | |
765 | 777 | | |
| |||
798 | 810 | | |
799 | 811 | | |
800 | 812 | | |
| 813 | + | |
801 | 814 | | |
802 | 815 | | |
803 | 816 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
512 | 512 | | |
513 | 513 | | |
514 | 514 | | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
515 | 538 | | |
516 | 539 | | |
517 | 540 | | |
| |||
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
203 | 224 | | |
204 | 225 | | |
205 | 226 | | |
| |||
0 commit comments