Skip to content

Commit

Permalink
Add websocket send example in TeamResource::create()
Browse files Browse the repository at this point in the history
Should close #111 when merged
  • Loading branch information
Reavershark committed Mar 28, 2024
1 parent dc79ea1 commit b5833b2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/java/telraam/api/TeamResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
import java.util.Objects;
import java.util.Optional;

import telraam.websocket.WebSocketMessageSingleton;


@Path("/team")
@Tag(name="Team")
Expand Down Expand Up @@ -48,6 +50,14 @@ public int create(Team team) {
));
}

WebSocketMessageSingleton.getInstance().sendToAll(
"new team (%s, %s, %s)".formatted(
team.getName(),
team.getId(),
team.getBatonId()
)
);

return ret;
}

Expand Down

0 comments on commit b5833b2

Please sign in to comment.