w.ham
w.ham
TTCTheo's Typesafe Cult
Created by w.ham on 4/27/2023 in #questions
How can I hit my trpc endpoint in a event handler?
that was issue
12 replies
TTCTheo's Typesafe Cult
Created by w.ham on 4/27/2023 in #questions
How can I hit my trpc endpoint in a event handler?
yea
12 replies
TTCTheo's Typesafe Cult
Created by w.ham on 4/27/2023 in #questions
How can I hit my trpc endpoint in a event handler?
sorry shouldve said
12 replies
TTCTheo's Typesafe Cult
Created by w.ham on 4/27/2023 in #questions
How can I hit my trpc endpoint in a event handler?
i got it working
12 replies
TTCTheo's Typesafe Cult
Created by w.ham on 4/27/2023 in #questions
How can I hit my trpc endpoint in a event handler?
heres what I am doing
12 replies
TTCTheo's Typesafe Cult
Created by w.ham on 4/27/2023 in #questions
How can I hit my trpc endpoint in a event handler?
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
console.log("Submitted form values:", formValues);
interface testtype {
style: string;
userId: string;
prompt: string;
type: string;
shape: string;
color: string;
}
const test: testtype = {
style: "realism",
userId: "clg5knnzg0000s78t69ue2dh2",
prompt: "a dancing panda",
type: "regular",
shape: "circular",
color: "red",
};
api.generateImages.generateImage.useQuery(test);
};

return (
<form onSubmit={handleSubmit} className="mx-auto max-w-md py-20">
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
console.log("Submitted form values:", formValues);
interface testtype {
style: string;
userId: string;
prompt: string;
type: string;
shape: string;
color: string;
}
const test: testtype = {
style: "realism",
userId: "clg5knnzg0000s78t69ue2dh2",
prompt: "a dancing panda",
type: "regular",
shape: "circular",
color: "red",
};
api.generateImages.generateImage.useQuery(test);
};

return (
<form onSubmit={handleSubmit} className="mx-auto max-w-md py-20">
12 replies