Preview:
 const handleDelete = (e: any) => {
        e.preventDefault();
        toast.promise(
            axiosInstance
                .delete(
                    `api/business/${businessStore?.id}/agreement/${singleData?.id}`
                )
                .then((res) => {
                    setAgreements(res?.data?.agreements);
                    setTypeFilterOptions(res?.data?.typeFilterOptions);
                }),
            {
                loading: "Deleteing agreement file",
                success: "Agreement file is deleted",
                error: (err: any) =>
                    err?.response?.data?.message
                        ? err?.response.data?.message
                        : err?.response?.data,
            }
        );
    };
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter