codecret | Software Engineer
codecret | Software Engineer
TtRPC
Created by Szymon on 2/7/2025 in #❓-help
error handling
that's true, I wonder if there is another way to handle zod validations, i think it can be handled from the front end anyways ?
9 replies
TtRPC
Created by Szymon on 2/7/2025 in #❓-help
error handling
No description
9 replies
TtRPC
Created by Szymon on 2/7/2025 in #❓-help
error handling
actually this returned the whole bunch of objects whereas i wanna see the message
9 replies
TtRPC
Created by Szymon on 2/7/2025 in #❓-help
error handling
No description
9 replies
TtRPC
Created by codecret | Software Engineer on 2/15/2025 in #❓-help
correct way to handle errors run time errors
thank youu
7 replies
TtRPC
Created by codecret | Software Engineer on 2/15/2025 in #❓-help
correct way to handle errors run time errors
No description
7 replies
TtRPC
Created by codecret | Software Engineer on 2/15/2025 in #❓-help
correct way to handle errors run time errors
the toast is working but at the same time i get an error
7 replies
TtRPC
Created by codecret | Software Engineer on 2/13/2025 in #❓-help
invalidate query
actually i wanted to comment it out , but didnt know how am i going to check if the data , getting invalidated or not , i placed the same table in the same page and the problem get fixed but i still want to navigate to the other page
16 replies
TtRPC
Created by codecret | Software Engineer on 2/13/2025 in #❓-help
invalidate query
however using utils.user.getUsers.refetch() is working idk why and how
16 replies
TtRPC
Created by codecret | Software Engineer on 2/13/2025 in #❓-help
invalidate query
actually even after awaiting the invalidation, it's still not updated , i wonder if it has anything related to the query which is being invalidated (this one)
const { data: users, isLoading } = trpc.user.getUsers.useQuery(undefined, {
refetchOnMount: false,
refetchOnReconnect: false,
});
const { data: users, isLoading } = trpc.user.getUsers.useQuery(undefined, {
refetchOnMount: false,
refetchOnReconnect: false,
});
16 replies
TtRPC
Created by codecret | Software Engineer on 2/13/2025 in #❓-help
invalidate query
const mutationAdd = trpc.user.addUser.useMutation({
onSuccess: () => {
utils.user.getUsers.invalidate();
console.log("invalidate getUsers after adding");
},
});

async function onSubmit(values: z.infer<ReturnType<typeof formSchema>>) {

await mutationAdd.mutateAsync(payload);
router.push("/admin/all-employees");
}
const mutationAdd = trpc.user.addUser.useMutation({
onSuccess: () => {
utils.user.getUsers.invalidate();
console.log("invalidate getUsers after adding");
},
});

async function onSubmit(values: z.infer<ReturnType<typeof formSchema>>) {

await mutationAdd.mutateAsync(payload);
router.push("/admin/all-employees");
}
actually invalidating query is not updating my user table
16 replies
TtRPC
Created by codecret | Software Engineer on 2/13/2025 in #❓-help
invalidate query
that's true , thanks Nick !
16 replies
TtRPC
Created by codecret | Software Engineer on 2/13/2025 in #❓-help
invalidate query
thanks its working, actually i used to do invalidate query when using useQuery by setting a mutation key and invalidate my query whenever any update changes
16 replies