From 485afb1007fceb22a94c5d92e01445be0d1a5783 Mon Sep 17 00:00:00 2001 From: Brook Gagnon Date: Sat, 31 Aug 2024 21:47:52 +0000 Subject: [PATCH] remove / from beginning of endpoint if needed (api v2 request js) --- js/api.js | 1 + 1 file changed, 1 insertion(+) diff --git a/js/api.js b/js/api.js index 971c5cd..c0ecd21 100644 --- a/js/api.js +++ b/js/api.js @@ -291,6 +291,7 @@ OB.API.download = function (url) { // API v2 request OB.API.request = async function ({ endpoint, method = "GET", data = null, raw = false }) { + if (endpoint.charAt(0) == "/") endpoint = endpoint.substr(1); const url = `/api/v2/${endpoint}`; const headers = {