Effect.catchTag("PrismaUniqueConstraintViolationError", ({constraint}) => Effect.gen(function* () {
if (constraint.includes("slug")) {
//data comes from an input here
return yield* new OrganizationSlugExistsError({slug: data.slug})
}
//data comes from an input here
return yield* new OrganizationNameExistsError({name: data.name})
})),
Effect.catchTag("PrismaUniqueConstraintViolationError", ({constraint}) => Effect.gen(function* () {
if (constraint.includes("slug")) {
//data comes from an input here
return yield* new OrganizationSlugExistsError({slug: data.slug})
}
//data comes from an input here
return yield* new OrganizationNameExistsError({name: data.name})
})),