Skip to content

Commit 538707f

Browse files
committed
Fix bug in config-api.
The function catalogExists should not parse the response as json. This CR fixes the crash if user call the function. Resolves: OLPEDGE-2504 Signed-off-by: Oleksii Zubko <ext-oleksii.zubko@here.com>
1 parent 7a433e1 commit 538707f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

@here/olp-sdk-dataservice-api/lib/config-api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ export type PackageTypeEnum = "experimental" | "small" | "medium" | "large";
10151015
export async function catalogExists(
10161016
builder: RequestBuilder,
10171017
params: { catalogHrn: string; billingTag?: string }
1018-
): Promise<any> {
1018+
): Promise<Response> {
10191019
const baseUrl = "/catalogs/{catalogHrn}".replace(
10201020
"{catalogHrn}",
10211021
UrlBuilder.toString(params["catalogHrn"])
@@ -1030,7 +1030,7 @@ export async function catalogExists(
10301030
headers
10311031
};
10321032

1033-
return builder.request<any>(urlBuilder, options);
1033+
return builder.requestBlob(urlBuilder, options);
10341034
}
10351035

10361036
/**

@here/olp-sdk-dataservice-api/test/ConfigApi.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ describe("ConfigApi", function() {
3535
};
3636
const builder = {
3737
baseUrl: "http://mocked.url",
38-
request: async (urlBuilder: UrlBuilder, options: any) => {
38+
requestBlob: async (urlBuilder: UrlBuilder, options: any) => {
3939
expect(urlBuilder.url).to.be.equal(
4040
"http://mocked.url/catalogs/mocked-catalogHrn?billingTag=mocked-billingTag"
4141
);

0 commit comments

Comments
 (0)