```const card = await this.prismaService.card.find...
# orm-help
g
Copy code
const card = await this.prismaService.card.findFirst({
      where: {
        locale: account.locale,
        OR: [
          { AND: [{ isEmptyCard: false }, { accountId: account.id }] },
          { isEmptyCard: true },
        ],
      },
    });
I use this code, and when both
OR
conditions are true, it returns the result of the last one
1
j
Wouldn’t an order by help?
❤️ 1
Actually you could just sort by isEmptyCard, I don’t know off the top of my head if you should sort asc or desc to get the first condition to appear first.
g
@Joshua Ohlman
orderBy: { accountId: 'desc' },
this helped me. Thank you!
j
You’re welcome!
❤️ 1