diff --git a/.gitignore b/.gitignore index 67e6383..26b1d16 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ .vscode .idea *.iml +target/ +project/target/ diff --git a/dokusho-server/src/main/scala/dokusho/ReadingHistoryRouter.scala b/dokusho-server/src/main/scala/dokusho/ReadingHistoryRouter.scala index efda646..386aa12 100644 --- a/dokusho-server/src/main/scala/dokusho/ReadingHistoryRouter.scala +++ b/dokusho-server/src/main/scala/dokusho/ReadingHistoryRouter.scala @@ -36,10 +36,8 @@ class ReadingHistoryRouter(readingHistoryService: ReadingHistoryService) { result <- json.fold(NotFound())(j => Ok(j)) } yield result case PUT -> Root / "history" / userId / "reset" => - for { - storedHistory: UserReadingHistory <- readingHistoryService.reset(userId) - json = storedHistory.asJson - result <- Ok(json) - } yield result + readingHistoryService.reset(userId) + .map(_.asJson) + .flatMap(j => Ok(j)) } } \ No newline at end of file