Converted put(api/announcement) to use useSend

Added useSendButtonCaption hook
Related to #19
This commit is contained in:
2023-07-17 12:18:54 +03:00
parent b360b06d34
commit b7bbd937b4
6 changed files with 100 additions and 95 deletions

View File

@ -24,6 +24,7 @@ function useSend<R, T>(
/** Don't use in useEffect. If you need request result, go with useFetch instead */
const doSend = useCallback(async (urlProps?: Record<string, string>, params?: Omit<RequestInit, 'method'>) => {
setLoading(true)
setError(null)
if (abortControllerRef.current) {
abortControllerRef.current.abort()