Skip to content

Commit

Permalink
Add entry checks against data insted of userId
Browse files Browse the repository at this point in the history
  • Loading branch information
RawToast committed Mar 25, 2018
1 parent e3a5d96 commit 5f860dd
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class MongoRepository(connectionString: String, databaseName: String, collection
for {
urh <- getUnsafe(userId)
days = urh.readingHistory.days
dayToUpdate = days.find(_.date == userId).getOrElse(Day(date, Seq.empty))
dayToUpdate = days.find(_.date == date).getOrElse(Day(date, Seq.empty))
updatedDay = entriesLens.modify(_ :+ entry)(dayToUpdate)
doc = daysLens.modify(upsertDay(updatedDay))(urh)
} yield doc
Expand Down

0 comments on commit 5f860dd

Please sign in to comment.