Merge pull request 'MaJ WS' (#15) from back-clecle into feature/all

Reviewed-on: #15
This commit is contained in:
ExostFlash 2025-06-03 07:16:53 +00:00
commit 81893b0dfe
3 changed files with 6 additions and 6 deletions

View file

@ -18,7 +18,7 @@ open class MatchWebSocketConfig : WebSocketMessageBrokerConfigurer {
registry.enableSimpleBroker(CHANNEL_MATCH_NAME) registry.enableSimpleBroker(CHANNEL_MATCH_NAME)
// Prefix for messages FROM client TO server // Prefix for messages FROM client TO server
registry.setApplicationDestinationPrefixes("/ws/matches") registry.setApplicationDestinationPrefixes("/ws")
} }
override fun registerStompEndpoints(registry: StompEndpointRegistry) { override fun registerStompEndpoints(registry: StompEndpointRegistry) {

View file

@ -71,7 +71,7 @@
date: document.getElementById("matchDate").value date: document.getElementById("matchDate").value
}; };
stompClient.send("/ws/matches/add", {}, JSON.stringify(match)); stompClient.send("/ws/add", {}, JSON.stringify(match));
displayMessage(match) displayMessage(match)
} }

View file

@ -63,15 +63,15 @@
function sendMatch() { function sendMatch() {
const match = { const match = {
id: 1, id: 1,
player1Id: parseInt(document.getElementById("player1Id").value), player1ID: parseInt(document.getElementById("player1Id").value),
player2Id: parseInt(document.getElementById("player2Id").value), player2ID: parseInt(document.getElementById("player2Id").value),
refereeId: parseInt(document.getElementById("refereeId").value), refereeID: parseInt(document.getElementById("refereeId").value),
score1: parseInt(document.getElementById("score1").value), score1: parseInt(document.getElementById("score1").value),
score2: parseInt(document.getElementById("score2").value), score2: parseInt(document.getElementById("score2").value),
date: document.getElementById("matchDate").value date: document.getElementById("matchDate").value
}; };
stompClient.send("/ws/matches/addPoint", {}, JSON.stringify({ stompClient.send("/ws/plusPoint", {}, JSON.stringify({
match: match, match: match,
playerId: match.player1Id playerId: match.player1Id
})); }));