Skip to content

Commit dfc74c8

Browse files
committed
fix: update @tanstack/react-query version and refactor mutation argument handling
1 parent fffd18c commit dfc74c8

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"dependencies": {
1515
"@elysiajs/eden": "1.4.5",
1616
"@prisma/client": "7.0.1",
17-
"@tanstack/react-query": "5.87.4",
17+
"@tanstack/react-query": "5.90.11",
1818
"elysia": "1.4.17",
1919
"jose": "6.1.3",
2020
"next": "16.0.6",

src/hooks/auth-hook.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ import { useMutation } from "@tanstack/react-query";
55
export function useRegisterMutation() {
66
return useMutation({
77
mutationFn: async (
8-
...args: Parameters<typeof rpc.api.auth.register.post>
9-
) => handleEden(await rpc.api.auth.register.post(...args)),
8+
args: Parameters<typeof rpc.api.auth.register.post>[0]
9+
) => handleEden(await rpc.api.auth.register.post(args)),
1010
});
1111
}
1212

1313
export function useLoginMutation() {
1414
return useMutation({
15-
mutationFn: async (...args: Parameters<typeof rpc.api.auth.login.post>) =>
16-
handleEden(await rpc.api.auth.login.post(...args)),
15+
mutationFn: async (args: Parameters<typeof rpc.api.auth.login.post>[0]) =>
16+
handleEden(await rpc.api.auth.login.post(args)),
1717
});
1818
}
1919

src/lib/utils/base.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export function handleEden<T, E = unknown>(
3939
if (response.error) throw response.error;
4040
return response.data;
4141
}
42+
4243
/**
4344
* Safe parsing utility for TypeBox schemas that returns a discriminated union result
4445
* rather than throwing errors. Similar to Zod's safeParse pattern.

0 commit comments

Comments
 (0)