Skip to content

Commit 5780786

Browse files
authored
feat(): Update method signature for http client invoker to use optional parameter (#299)
(tiny fix) update method signature for http client invoker Signed-off-by: Shubham Sharma <[email protected]>
1 parent bf5955d commit 5780786

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/implementation/Client/HTTPClient/invoker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default class HTTPClientInvoker implements IClientInvoker {
2323
this.client = client;
2424
}
2525

26-
async invoke(appId: string, methodName: string, method: HttpMethod = HttpMethod.GET, data: object = {}): Promise<object> {
26+
async invoke(appId: string, methodName: string, method: HttpMethod = HttpMethod.GET, data?: object): Promise<object> {
2727
const fetchOptions = {
2828
method
2929
};
@@ -35,7 +35,7 @@ export default class HTTPClientInvoker implements IClientInvoker {
3535
};
3636
}
3737

38-
if (method !== HttpMethod.GET && data !== {}) {
38+
if (method !== HttpMethod.GET && data !== undefined) {
3939
// @ts-ignore
4040
fetchOptions.body = JSON.stringify(data);
4141
}

0 commit comments

Comments
 (0)