trpc
trpc.product.getDiscount
import { createTRPCRouter, publicProcedure } from "~/server/api/trpc";import { z } from "zod";const productsRouter = createTRPCRouter({ get: publicProcedure .input(z.object({ productId: z.string() })) .query(async ({ input }) => { const { productId } = input; // Fetch product by ID logic here }), // Nested router for handling discounts related to a specific product discount: createTRPCRouter({ get: publicProcedure .input(z.object({ productId: z.string() })) .query(async ({ input }) => { const { productId } = input; }), }),});export default productsRouter;