From f42c23733afca3197ceba7596bb5c85a67f898ef Mon Sep 17 00:00:00 2001 From: rawtoast Date: Sun, 25 Mar 2018 15:32:19 +0100 Subject: [PATCH] Reset and additional .gitignore entries --- .gitignore | 2 ++ .../src/main/scala/dokusho/ReadingHistoryRouter.scala | 8 +++----- 2 files changed, 5 insertions(+), 5 deletions(-) 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