I am trying to extract data from a Prisma query in order to determine if the data is empty or not and, if empty, then return my own custom 404 response.
The code that returns my ‘client’ results is:
const client = this.prisma.client.findUnique({
where: clientWhereUniqueInput,
});
Which comes back in the form of a promise (I think).
I’ve tried printing out ‘client’, but it just gives me this and I can’t really make it any more verbose:
{
then: [Function: then],
catch: [Function: catch],
finally: [Function: finally],
requestTransaction: [Function: requestTransaction],
[Symbol(Symbol.toStringTag)]: 'PrismaPromise'
}
And when this is returned to my controller, it eventually shows a JSON object in the body of the response. This is what I want to capture, before it’s returned.