throw new TRPCError({ code: "BAD_REQUEST", message: "Not enough credits", });
message
onSubmit
async function onSubmit(values: z.infer<typeof formSchema>) { try { await createImage({ prompt: values.prompt, type: values.type, }); router.refresh(); } catch (cause) { console.log(cause); toast({ title: "Error", description: "An error occurred while creating your image. Please try again.", }); } }
"message": "No \"query\"-procedure on path \"checkout.stripe\"","code": -32004,
import { createTRPCRouter, publicProcedure } from "@/server/api/trpc";export const checkoutRouter = createTRPCRouter({ stripe: publicProcedure.mutation(() => { return "Hello"; }),});
http://localhost:3000/api/trpc/checkout.stripe