Skip to content

Commit 4cfed9d

Browse files
committed
fix: use branch query param only when specified
1 parent e27827b commit 4cfed9d

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/commands/sync/compare.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const asyncHandler = (config: Schema) =>
3131
opts.client.GET('/v2/projects/{projectId}/all-keys', {
3232
params: {
3333
path: { projectId: opts.client.getProjectId() },
34-
query: { branch: opts.branch },
34+
...(!!opts.branch && { query: { branch: opts.branch } }),
3535
},
3636
})
3737
);

src/commands/sync/sync.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ const syncHandler = (config: Schema) =>
9898
opts.client.GET('/v2/projects/{projectId}/all-keys', {
9999
params: {
100100
path: { projectId: opts.client.getProjectId() },
101-
query: { branch: opts.branch },
101+
...(!!opts.branch && { query: { branch: opts.branch } }),
102102
},
103103
})
104104
);
@@ -168,7 +168,7 @@ const syncHandler = (config: Schema) =>
168168
opts.client.POST('/v2/projects/{projectId}/keys/import', {
169169
params: {
170170
path: { projectId: opts.client.getProjectId() },
171-
query: { branch: opts.branch },
171+
...(!!opts.branch && { query: { branch: opts.branch } }),
172172
},
173173
body: { keys },
174174
})
@@ -189,6 +189,7 @@ const syncHandler = (config: Schema) =>
189189
`Deleting unused keys${appendBranch(opts.branch)}...`,
190190
opts.client.DELETE('/v2/projects/{projectId}/keys', {
191191
params: { path: { projectId: opts.client.getProjectId() } },
192+
...(!!opts.branch && { query: { branch: opts.branch } }),
192193
body: { ids },
193194
})
194195
);

src/commands/tag.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const tagHandler = (config: Schema) =>
4949
opts.client.PUT('/v2/projects/{projectId}/tag-complex', {
5050
params: {
5151
path: { projectId: opts.client.getProjectId() },
52-
query: { branch: opts.branch },
52+
...(!!opts.branch && { query: { branch: opts.branch } }),
5353
},
5454
body: {
5555
filterTag: opts.filterTag,

0 commit comments

Comments
 (0)