From ac7843b39359bbe81274aff88f36d833cf78079e Mon Sep 17 00:00:00 2001 From: Foxhoundn Date: Tue, 10 Dec 2024 17:03:53 +0100 Subject: [PATCH] Bump version to 0.4.11 and enhance QorusRequest to handle 204 and 404 status codes by returning an empty object --- package.json | 2 +- src/QorusRequest.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 37d9ee2..1dccdc2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@qoretechnologies/ts-toolkit", - "version": "0.4.10", + "version": "0.4.11", "description": "Utility library to interact with Qorus Integration Engine & Qore Language", "keywords": [ "qoretechnologies", diff --git a/src/QorusRequest.ts b/src/QorusRequest.ts index e6feae4..7252148 100644 --- a/src/QorusRequest.ts +++ b/src/QorusRequest.ts @@ -118,6 +118,10 @@ export class QorusRequest { throw new ErrorQorusRequest(text); } + if (promise.status === 204 || promise.status === 404) { + return { data: {} }; + } + let json: any; // We need to turn the promise to json but if the response is empty we need to return an empty object