mirror of
https://github.com/wasp-lang/wasp.git
synced 2024-12-24 17:44:21 +03:00
Cleanup
This commit is contained in:
parent
67de09345d
commit
ee7c6dec2f
@ -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) {
|
||||
|
@ -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(
|
||||
|
@ -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]
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user