import { z } from "zod";
import { db } from "~/server/db";
import {
createTRPCRouter,
protectedProcedure,
publicProcedure,
} from "~/server/api/trpc";
export const certificateRouter = createTRPCRouter({
create: publicProcedure
.input(
z.object({ name: z.string().min(1), description: z.string().min(1) }),
)
.mutation(async ({ ctx, input }) => {
// ERROR HERE: Unsafe assignment of an `any` value.
const certificate = await db.certificate.create({
select: {
id: true,
},
data: {
name: input.name,
description: input.description,
certificateId: "1",
organizationId: "1",
},
});
// ERROR HERE: Unsafe return of an `any` typed value.
return certificate;
}),
});
import { z } from "zod";
import { db } from "~/server/db";
import {
createTRPCRouter,
protectedProcedure,
publicProcedure,
} from "~/server/api/trpc";
export const certificateRouter = createTRPCRouter({
create: publicProcedure
.input(
z.object({ name: z.string().min(1), description: z.string().min(1) }),
)
.mutation(async ({ ctx, input }) => {
// ERROR HERE: Unsafe assignment of an `any` value.
const certificate = await db.certificate.create({
select: {
id: true,
},
data: {
name: input.name,
description: input.description,
certificateId: "1",
organizationId: "1",
},
});
// ERROR HERE: Unsafe return of an `any` typed value.
return certificate;
}),
});