Skip to content

Commit

Permalink
feat: added abort signal to getsoapfetch (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
giuliano176 authored Nov 23, 2022
1 parent 3042aa6 commit 3c039e1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/network/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,16 @@ const handleResponse = <R>(api: string, res: SoapResponse<R>): R | ErrorSoapBody
};
export const getSoapFetch =
(app: string) =>
<Request, Response>(api: string, body: Request, otherAccount?: string): Promise<Response> => {
<Request, Response>(
api: string,
body: Request,
otherAccount?: string,
signal?: AbortSignal
): Promise<Response> => {
const { zimbraVersion, account } = useAccountStore.getState();
const { notify, session } = useNetworkStore.getState();
return fetch(`/service/soap/${api}Request`, {
signal,
method: 'POST',
headers: {
'Content-Type': 'application/json'
Expand Down

0 comments on commit 3c039e1

Please sign in to comment.