camunda/camunda-8-js-sdk

Can't reach Members API endpoint because /cluster/ is being prepended to the base URL for all REST calls.

Closed this issue · 0 comments

SDK Component

Console

Expected Behavior

the Members API endpoint is not behind /clusters/

Current Behavior

Getting an error "you should not be here" when using .getUsers() or other Members methods.

Possible Solution

Do not prefix the base URL (or move the Members endpoints to /clusters/members but members are not cluster specific so this might not be the change you want to make.) Best thing to do would be to not prefix and then add 'clusters/' to cluster specific endpoints.

const prefixUrl = `${baseUrl}/clusters`

Another fix/workaround would be to change the member calls to use for example '../members' This works but maybe a better fix is prudent.

async getUsers(): Promise<Dto.Member[]> {

async getUsers() {
const headers = await this.getHeaders();
const rest = await this.rest;
return rest
.get('../members', {
headers,
})
.json();
}