Skip to content

Commit

Permalink
remove / from beginning of endpoint if needed (api v2 request js)
Browse files Browse the repository at this point in the history
  • Loading branch information
brookgagnon committed Aug 31, 2024
1 parent be67a11 commit 485afb1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions js/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 485afb1

Please sign in to comment.