This commit is contained in:
clemcle81500 2025-06-03 08:57:46 +02:00
parent 608e0f7680
commit e73b2daaf0
3 changed files with 6 additions and 6 deletions

View file

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

View file

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

View file

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