Alejo Garcia
Alejo Garcia11mo ago

Type '{}' is not assignable in server query

Type '{ input: { slug: string; }; "": any; }' is not assignable to type 'string | StringFilter<"Category"> | undefined'.
ts getCategoryBySlug: publicProcedure
.input(z.object({ slug: z.string() }))

.query(async ({ input, ctx }) => {
const category = await ctx.prisma.category.findUnique({
where: {
slug: {input.slug},
},
});
ts getCategoryBySlug: publicProcedure
.input(z.object({ slug: z.string() }))

.query(async ({ input, ctx }) => {
const category = await ctx.prisma.category.findUnique({
where: {
slug: {input.slug},
},
});
0 Replies
No replies yetBe the first to reply to this messageJoin