From 4f04a51e1783a155f63c71d8bb248a394689c951 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Wed, 21 Dec 2022 16:07:21 +0100 Subject: [PATCH] FIX: prevents chat-api to generate double slash URLS (#19549) It was not causing any visible issue, but better generate the proper URL. --- .../assets/javascripts/discourse/services/chat-api.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/chat/assets/javascripts/discourse/services/chat-api.js b/plugins/chat/assets/javascripts/discourse/services/chat-api.js index 4a24d8a9b6e..d03cb4a8a0a 100644 --- a/plugins/chat/assets/javascripts/discourse/services/chat-api.js +++ b/plugins/chat/assets/javascripts/discourse/services/chat-api.js @@ -213,28 +213,28 @@ export default class ChatApi extends Service { } #getRequest(endpoint, data = {}) { - return ajax(`${this.#basePath}/${endpoint}`, { + return ajax(`${this.#basePath}${endpoint}`, { type: "GET", data, }); } #putRequest(endpoint, data = {}) { - return ajax(`${this.#basePath}/${endpoint}`, { + return ajax(`${this.#basePath}${endpoint}`, { type: "PUT", data, }); } #postRequest(endpoint, data = {}) { - return ajax(`${this.#basePath}/${endpoint}`, { + return ajax(`${this.#basePath}${endpoint}`, { type: "POST", data, }); } #deleteRequest(endpoint, data = {}) { - return ajax(`${this.#basePath}/${endpoint}`, { + return ajax(`${this.#basePath}${endpoint}`, { type: "DELETE", data, });