Skip to content

Commit

Permalink
Add entry adjustments, reduced cluster size
Browse files Browse the repository at this point in the history
  • Loading branch information
RawToast committed Mar 25, 2018
1 parent 32fa2df commit 0a0ff1d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ReadingHistoryEndpoint(readingHistoryService: ReadingHistoryService) {
json: Json = SuccessfulPut(storedHistory.userId).asJson
response <- Ok(json)
} yield response
case req@PUT -> Root / "history" / userId / "add" =>
case req@POST -> Root / "history" / userId / "add" =>
implicit val entryDecoder: EntityDecoder[IO, Entry] = jsonOf[IO, Entry]
for {
entry <- req.as[Entry]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ReadingHistoryService(mongoRepository: MongoRepository) {
val newDay = Day(LocalDate.now().atStartOfDay().toString, Seq.empty)
val ndays = if (days.exists(_.date == newDay.date)) days else newDay +: days

ndays.withFilter(d => d.date == LocalDate.now().atStartOfDay().toString)
ndays.withFilter(_.date == newDay.date)
.map(d => d.copy(entries = entry +: d.entries))
}
}
2 changes: 1 addition & 1 deletion kube/gcloud/backend-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ spec:
selector:
matchLabels:
name: backend
replicas: 2
replicas: 1
template:
metadata:
labels:
Expand Down
2 changes: 1 addition & 1 deletion kube/gcloud/mongo-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ spec:
selector:
matchLabels:
name: mongo
replicas: 2
replicas: 1
template:
metadata:
labels:
Expand Down

0 comments on commit 0a0ff1d

Please sign in to comment.