Sabin Adams
12/23/2021, 9:37 PMconst entityStates = await this.prisma.entityState.findMany({
select: { id: true, entityTypeID: true },
where: {
name: state
}
})
const entityTypes = await this.prisma.entityType.findMany({
select: { id: true },
where: {
name: 'Enrollment',
id: { in: entityStates.map( state => state.entityTypeID ) }
}
})
The logic I'm looking for would look something like this
const entityTypes = await this.prisma.entityType.findMany({
select: { id: true },
where: {
name: 'Enrollment',
EntityStates: {
where: {
name: state
}
}
}
})David A. Black
12/24/2021, 9:35 AM{ in: { await…) but it was pretty ugly and also the resulting objects, though they thought they were User objects (my test case), seemed to be malformed in some way — i wasn’t able to do anything with themSabin Adams
12/28/2021, 6:39 PM