Skip to content

Commit

Permalink
fix: path can be empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniomuso committed Aug 28, 2023
1 parent 3155e5d commit 1195451
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/gitlab/src/api/GitlabCIClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ export class GitlabCIClient implements GitlabCIApi {
}

const response = await fetch(
`${apiUrl}/${path}?${new URLSearchParams(query).toString()}`,
`${apiUrl}${path ? `/${path}` : ''}?${new URLSearchParams(
query
).toString()}`,
options
);
if (response.status === 200) {
Expand Down Expand Up @@ -121,7 +123,7 @@ export class GitlabCIClient implements GitlabCIApi {
body: JSON.stringify(query),
};

return this.callApi<T>('graphql', {}, 'graphql', options);
return this.callApi<T>('', {}, 'graphql', options);
}

async getPipelineSummary(
Expand Down

0 comments on commit 1195451

Please sign in to comment.