I want to return an error if I try to update an inexistant row in Slick.
my query:
userPromotions.filter(promo =>
promo.code === code).update(myUpdatedRow)
the query I try to do (I have an error cause "rowToUpdate.exist" is a Rep[Boolean] and not a Boolean):
val rowToUpdate = userPromotions.filter(promo => promo.code === code)
if(rowToUpdate.exist) rowToUpdate.update(myUpdatedRow)
else NotFound
is there any way to do that in a single query ?