Alan_szt
Alan_szt
Explore posts from servers
DTDrizzle Team
Created by Alan_szt on 3/29/2025 in #help
Keyword "with" is not typed
Hello. I need some help here. https://github.com/drizzle-team/drizzle-orm/issues/4297 Any idea why the keyword "with" is not typed
1 replies
BABetter Auth
Created by Alan_szt on 3/28/2025 in #help
Exclude role in the signup (frontend) as it should be driven from the backend
Hey Guys, I added the field role So i added this in React: export const authClient = createAuthClient({ plugins: [inferAdditionalFields({ user: { role: { type: "string" } } })], but now, when a user signup, we should not ask for role... this field should not be driven by the frontend.. How can exclude it? #help
const data = await authClient.signUp.email(
{
email,
password,
name,
role: "CLIENT", // TODO: remove this
},
{
onRequest: (ctx) => {
console.log("onRequest", ctx);
//show loading
},
onSuccess: (ctx) => {
console.log("onSuccess", ctx);
//redirect to the dashboard or sign in page
},
onError: (ctx) => {
// display the error message
console.log("onError", ctx);
},
}
const data = await authClient.signUp.email(
{
email,
password,
name,
role: "CLIENT", // TODO: remove this
},
{
onRequest: (ctx) => {
console.log("onRequest", ctx);
//show loading
},
onSuccess: (ctx) => {
console.log("onSuccess", ctx);
//redirect to the dashboard or sign in page
},
onError: (ctx) => {
// display the error message
console.log("onError", ctx);
},
}
5 replies
DTDrizzle Team
Created by Alan_szt on 2/3/2025 in #help
I don't understand why the keyword `with` is not working.
No description
7 replies
TtRPC
Created by Alan_szt on 7/18/2024 in #❓-help
How can I set a Cookie from the server (for the login)?
No description
4 replies
TtRPC
Created by Alan_szt on 7/18/2024 in #❓-help
How to get access to the types generated by the server in the frontend (React)?
In this example, how do you replace data: any to the correct type?
import { trpc } from "../utils/trpc";

type Props = {
onSuccess: (data: any) => void;
};
export function CreateWorker(props: Props) {
const createWorkerMutation = trpc.createWorker.useMutation();

const handleCreateWorker = () => {
createWorkerMutation.mutate(
{ data: "hello" },
{
onSuccess: (data) => props.onSuccess(data),
}
);
};
return <button onClick={handleCreateWorker}>create</button>;
}
import { trpc } from "../utils/trpc";

type Props = {
onSuccess: (data: any) => void;
};
export function CreateWorker(props: Props) {
const createWorkerMutation = trpc.createWorker.useMutation();

const handleCreateWorker = () => {
createWorkerMutation.mutate(
{ data: "hello" },
{
onSuccess: (data) => props.onSuccess(data),
}
);
};
return <button onClick={handleCreateWorker}>create</button>;
}
3 replies