Fix Engagement Dashboard API requests (#24142)

pull/24217/head
Matheus Barbosa Silva 4 years ago committed by Diego Sampaio
parent 21045735b2
commit 699de9ced1
No known key found for this signature in database
GPG Key ID: E060152B30502562
  1. 2
      ee/client/lib/getFromRestApi.ts

@ -14,7 +14,7 @@ export const getFromRestApi =
? void
: Serialized<OperationParams<'GET', MatchPathPattern<TPath>>>,
): Promise<Serialized<OperationResult<'GET', MatchPathPattern<TPath>>>> => {
const response = await APIClient.get(endpoint, params);
const response = await APIClient.get(endpoint.replace(/^\/+/, ''), params);
if (typeof response === 'string') {
throw new Error('invalid response data type');

Loading…
Cancel
Save