mirror of
https://github.com/jdalrymple/gitbeaker.git
synced 2026-01-25 16:04:01 +00:00
fix: Fix error due to Typescript 3.5.1
encodeURIComponent() does not handle undefined. To be precise, it actually does and returns undefined, but normally that is an error, so the Typescript definition wants sensible input values, i.e. string | number | boolean.
This commit is contained in:
parent
5474f0658f
commit
bd4e14107e
@ -87,11 +87,12 @@ class MergeRequests extends BaseService {
|
||||
projectId: ProjectId,
|
||||
{ mergerequestIId, ...options }: { mergerequestIId?: MergeRequestId } & BaseRequestOptions,
|
||||
) {
|
||||
const [pId, mIId] = [projectId, mergerequestIId].map(encodeURIComponent);
|
||||
const pId = encodeURIComponent(projectId);
|
||||
|
||||
let url;
|
||||
|
||||
if (mergerequestIId) {
|
||||
const mIId = encodeURIComponent(mergerequestIId);
|
||||
url = `projects/${pId}/merge_requests/${mIId}/approvals`;
|
||||
} else {
|
||||
url = `projects/${pId}/approvals`;
|
||||
@ -106,11 +107,12 @@ class MergeRequests extends BaseService {
|
||||
approverGroupIds: GroupId[],
|
||||
{ mergerequestIId, ...options }: { mergerequestIId?: MergeRequestId } & BaseRequestOptions,
|
||||
) {
|
||||
const [pId, mIId] = [projectId, mergerequestIId].map(encodeURIComponent);
|
||||
const pId = encodeURIComponent(projectId);
|
||||
|
||||
let url;
|
||||
|
||||
if (mergerequestIId) {
|
||||
const mIId = encodeURIComponent(mergerequestIId);
|
||||
url = `projects/${pId}/merge_requests/${mIId}/approvers`;
|
||||
} else {
|
||||
url = `projects/${pId}/approvers`;
|
||||
@ -179,11 +181,12 @@ class MergeRequests extends BaseService {
|
||||
projectId: ProjectId,
|
||||
{ mergerequestIId, ...options }: { mergerequestIId?: MergeRequestId } & BaseRequestOptions,
|
||||
) {
|
||||
const [pId, mIId] = [projectId, mergerequestIId].map(encodeURIComponent);
|
||||
const pId = encodeURIComponent(projectId);
|
||||
|
||||
let url;
|
||||
|
||||
if (mergerequestIId) {
|
||||
const mIId = encodeURIComponent(mergerequestIId);
|
||||
url = `projects/${pId}/merge_requests/${mIId}/approvals`;
|
||||
} else {
|
||||
url = `projects/${pId}/approvals`;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user