X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FGame.vue;h=7f1bd407bcb57779c0c6c1bc9620f014433383b5;hp=4ebc8f4c33dcdb040be017bad7d0102e4cdbf591;hb=e57c4de4148d43e7635e09adcde4e56585aea303;hpb=e01e086d96f3c0f04761d269e6a34ba0b6014a56 diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue index 4ebc8f4c..7f1bd407 100644 --- a/client/src/views/Game.vue +++ b/client/src/views/Game.vue @@ -331,8 +331,13 @@ export default { clearChat: function() { // Nothing more to do if game is live (chats not recorded) if (this.game.type == "corr") { - if (!!this.game.mycolor) - ajax("/chats", "DELETE", {gid: this.game.id}); + if (!!this.game.mycolor) { + ajax( + "/chats", + "DELETE", + { data: { gid: this.game.id } } + ); + } this.$set(this.game, "chats", []); } }, @@ -639,11 +644,13 @@ export default { "/games", "PUT", { - gid: this.gameRef.id, - newObj: obj - }, - () => { - if (!!callback) callback(); + data: { + gid: this.gameRef.id, + newObj: obj + }, + success: () => { + if (!!callback) callback(); + } } ); }, @@ -865,13 +872,20 @@ export default { const gid = this.gameRef.id; if (Number.isInteger(gid) || !isNaN(parseInt(gid))) { // corr games identifiers are integers - ajax("/games", "GET", { gid: gid }, res => { - let g = res.game; - g.moves.forEach(m => { - m.squares = JSON.parse(m.squares); - }); - afterRetrieval(g); - }); + ajax( + "/games", + "GET", + { + data: { gid: gid }, + success: (res) => { + let g = res.game; + g.moves.forEach(m => { + m.squares = JSON.parse(m.squares); + }); + afterRetrieval(g); + } + } + ); } else // Local game