Commit 47bc86f
authored
fix(frontend): type error in useServiceUsageQuery.ts (#6081)
### 💭 Notes
Without the change I was getting this error:
```ERROR in ./jsapp/js/account/usage/useServiceUsageQuery.ts:135:3
TS2322: Type 'UseQueryResult<UsageState | undefined, Error>' is not assignable to type 'UseQueryResult<UsageState>'.
Type 'QueryObserverRefetchErrorResult<UsageState | undefined, Error>' is not assignable to type 'UseQueryResult<UsageState>'.
Type 'QueryObserverRefetchErrorResult<UsageState | undefined, Error>' is not assignable to type 'QueryObserverRefetchErrorResult<UsageState, Error>'.
Type 'UsageState | undefined' is not assignable to type 'UsageState'.
Type 'undefined' is not assignable to type 'UsageState'.
133 | }, [params?.shouldForceInvalidation])
134 |
> 135 | return useQuery({
| ^^^^^^
136 | queryKey: [QueryKeys.serviceUsage, organizationData?.id],
137 | queryFn: () => loadUsage(organizationData?.id || null),
138 | // A low stale time is needed to avoid calling the API twice on some situations
```
I remember I was getting the same error after bumping some react-query
related dependency. But now I started getting this on `main` without the
bump.1 parent 73f76fe commit 47bc86f
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| |||
0 commit comments