mirror of
https://github.com/hanzoai/calendar.git
synced 2026-09-24 22:42:24 +00:00
30 lines
605 B
TypeScript
30 lines
605 B
TypeScript
import { prisma } from "@calcom/prisma";
|
|
|
|
import type { TrpcSessionUser } from "../../../types";
|
|
import type { TAdminVerifyWorkflowsSchema } from "./verifyWorkflows.schema";
|
|
|
|
type GetOptions = {
|
|
ctx: {
|
|
user: NonNullable<TrpcSessionUser>;
|
|
};
|
|
input: TAdminVerifyWorkflowsSchema;
|
|
};
|
|
|
|
export const verifyWorkflows = async ({ input }: GetOptions) => {
|
|
const { userId } = input;
|
|
|
|
await prisma.workflowStep.updateMany({
|
|
where: {
|
|
workflow: {
|
|
userId,
|
|
},
|
|
verifiedAt: null,
|
|
},
|
|
data: {
|
|
verifiedAt: new Date(),
|
|
},
|
|
});
|
|
};
|
|
|
|
export default verifyWorkflows;
|