em.nativeDelete returns how many entities are deleted so I can do:
const count = await this.em.nativeDelete(User, {id});
if(!count){
throw new EntitiyNotFoundException(`User with id: ${id} is not found`);
}
Is there a way to do the same with remove(). It returns the EntityManager how can I check if the there is an entity deleted:
const user = this.em.getReference(User, id);
await this.em.remove(user);