This commit is contained in:
Mihovil Ilakovac 2024-11-26 16:13:05 +01:00
parent 67de09345d
commit ee7c6dec2f
4 changed files with 2 additions and 7 deletions

View File

@ -23,8 +23,6 @@ function createUserGetter(): Query<void, AuthUser | null> {
try {
const response = await api.get(getMeRoute.path)
const userData = superjsonDeserialize<AuthUserData | null>(response.data)
// TODO: figure out why overloading is not working
// @ts-ignore
return makeAuthUserIfPossible(userData)
} catch (error) {
if (error.response?.status === 401) {

View File

@ -211,11 +211,9 @@ function makeOptimisticUpdateMutationFn<Input, Output, CachedData>(
return (function performActionWithOptimisticUpdates(item: Input) {
const specificOptimisticUpdateDefinitions = optimisticUpdateDefinitions.map(
(generalDefinition) =>
// @ts-ignore
getOptimisticUpdateDefinitionForSpecificItem(generalDefinition, item)
);
return (actionFn as InternalAction<Input, Output>).internal(
// @ts-ignore
item,
specificOptimisticUpdateDefinitions
);
@ -273,7 +271,6 @@ function makeRqOptimisticUpdateOptions<ActionInput, CachedData>(
// Attempt to optimistically update the cache using the new value.
try {
// @ts-ignore
queryClient.setQueryData(queryKey, updateQuery);
} catch (e) {
console.error(

View File

@ -18,7 +18,7 @@ import {
// Details here: https://github.com/wasp-lang/wasp/issues/2017
export function makeQueryCacheKey<Input, Output>(
query: Query<Input, Output>,
payload?: Input
payload: Input
): (string | Input)[] {
return payload !== undefined ?
[...query.queryCacheKey, payload]

View File

@ -93,4 +93,4 @@ type ClientOperationWithNonAnyInput<Input, Output> =
? (args?: unknown) => Promise<Output>
: [Input] extends [void]
? () => Promise<Output>
: (args?: Input) => Promise<Output>
: (args: Input) => Promise<Output>