Commit f15e891
authored
Fix: correctly pass query params into /templates infra openapi-fetch (#77)
This pr fixes correct invocation of `/templates` infra route to get the
correct templates based on the `teamID`. Previously the query param for
`teamID` was passed outside the `params` prop, which made it look like
the query params are passed correctly, but actually they were not
applied to the final invocation url.
This resulted in the templates still being returned, but the team for
which the templates are returned was arbitrarily chosen, based on the
user details inferred from the access token. As a result, users of the
dashboard saw the same templates, regardless of their selected team.
This issue was tricky to spot, since the infra route for `/templates`
accepts this param as nullable and does not throw, but rather return the
templates for an arbitrary team.
Additionally this pr:
- improves the openapi-fetch client definition to explicitly use
next.js's version of fetch instead of globalThis.fetch
- next.js fetch logging by default, which makes issues like these easier
to spot in development
- improves the `VERBOSE` flag condition, for being able to turn of
verbose logging in development environments1 parent 3cb0e60 commit f15e891
File tree
5 files changed
+17
-10
lines changed- src
- configs
- lib/clients
- server
- sandboxes
- templates
5 files changed
+17
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
20 | 25 | | |
21 | 26 | | |
22 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
| 2 | + | |
5 | 3 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
8 | 13 | | |
9 | 14 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | 36 | | |
40 | 37 | | |
41 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| |||
0 commit comments