Skip to content

Commit 99dedad

Browse files
author
dchoi1
committed
Modified return for CurrentStateRequest within ClientManager from json to the original hashmap
1 parent c38cf64 commit 99dedad

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/actors/ClientManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public void onReceive(Object message) throws Throwable {
111111
DiffUpdate diffUpdate = new DiffUpdate(lotName, newOccupancy);
112112
tellAllClients(diffUpdate);
113113
} else if (message instanceof CurrentStateRequest) {
114-
getSender().tell(Json.toJson(allParkingLotState), getSelf());
114+
getSender().tell(new HashMap(allParkingLotState), getSelf());
115115
} else if (message instanceof KeepAliveMessage) {
116116
tellAllClients(message);
117117
} else {

app/controllers/ParkingController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public CompletionStage<Result> status() {
133133
//taken straight from documentation
134134
//https://www.playframework.com/documentation/2.5.x/JavaAkka#Creating-and-using-actors
135135
return FutureConverters.toJava(ask(clientManager, new CurrentStateRequest(), 1000)
136-
).thenApply(response -> ok((JsonNode) response));
136+
).thenApply(response -> ok(Json.toJson(response)));
137137
}
138138

139139

0 commit comments

Comments
 (0)