Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { db } from "@cascading/db/prisma";
- const workflowFields = await db.workflowFields.findMany({
- where: {
- // this is the ID of the workflow schema that you want to copy from
- workflowSchemaId: 'clr711oof0056tnh91cxxcevs'
- }
- })
- await Promise.all(workflowFields.map(async (workflowField) => {
- return await db.workflowFields.create({
- data: {
- dataType: workflowField.dataType,
- name: workflowField.name,
- order: workflowField.order,
- codeName: workflowField.codeName,
- defaultValue: workflowField.defaultValue,
- description: workflowField.description,
- isInput: workflowField.isInput,
- options: workflowField.options,
- required: workflowField.required,
- validation: workflowField.validation,
- // 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