Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { db } from "@cascading/db/prisma";
- const workflowCards = await db.workflowCard.findMany({
- where: {
- // this is the ID of the workflow schema that you want to copy from
- workflowSchemaId: 'clr711oof0056tnh91cxxcevs'
- }
- })
- await Promise.all(workflowCards.map(async (workflowField) => {
- return await db.workflowCard.create({
- data: {
- name: workflowField.name,
- codeName: workflowField.codeName,
- order: workflowField.order,
- getNextCard: workflowField.getNextCard,
- isFirstCard: workflowField.isFirstCard,
- // this is the ID of the workflow schema that you want to copy to
- workflowSchemaId: 'clszn5h57001mn0xy36wbcxys'
- }
- })
- }))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement