feat: deal updating on the server

This commit is contained in:
2025-08-05 16:33:04 +04:00
parent c98a5cc811
commit 236c0dcf10
5 changed files with 163 additions and 22 deletions

View File

@ -17,6 +17,9 @@ import type {
UpdateBoardData,
UpdateBoardErrors,
UpdateBoardResponses,
UpdateDealData,
UpdateDealErrors,
UpdateDealResponses,
UpdateStatusData,
UpdateStatusErrors,
UpdateStatusResponses,
@ -148,3 +151,24 @@ export const getDeals = <ThrowOnError extends boolean = false>(
...options,
});
};
/**
* Update Deal
*/
export const updateDeal = <ThrowOnError extends boolean = false>(
options: Options<UpdateDealData, ThrowOnError>
) => {
return (options.client ?? _heyApiClient).patch<
UpdateDealResponses,
UpdateDealErrors,
ThrowOnError
>({
responseType: "json",
url: "/deal/{dealId}",
...options,
headers: {
"Content-Type": "application/json",
...options.headers,
},
});
};