diff --git a/src/api/protectedApiClient.ts b/src/api/protectedApiClient.ts index 0fec67a3..71339a01 100644 --- a/src/api/protectedApiClient.ts +++ b/src/api/protectedApiClient.ts @@ -127,9 +127,7 @@ export interface ProtectedApiClient { ) => Promise; readonly addSites: (request: AddSitesRequest) => Promise; readonly sendEmail: (request: SendEmailRequest) => Promise; - readonly deleteImage: ( - imageId: number, - ) => Promise; + readonly deleteImage: (imageId: number) => Promise; readonly filterSites: ( params: FilterSitesParams, ) => Promise; @@ -201,7 +199,7 @@ export const ParameterizedApiRoutes = { NAME_SITE_ENTRY: (siteId: number): string => `${baseSiteRoute}${siteId}/name_entry`, DELETE_IMAGE: (imageId: number): string => - `${baseSiteRoute}site_image/${imageId}`, + `${baseSiteRoute}site_image/${imageId}`, }; export const ParameterizedAdminApiRoutes = { diff --git a/src/components/treePage/siteImageCarousel.tsx b/src/components/treePage/siteImageCarousel.tsx index 1ad28a29..f0957a76 100644 --- a/src/components/treePage/siteImageCarousel.tsx +++ b/src/components/treePage/siteImageCarousel.tsx @@ -1,5 +1,5 @@ import React, { useState } from 'react'; -import {Button, Carousel, message, Modal, Space} from 'antd'; +import { Button, Carousel, message, Modal, Space } from 'antd'; import LeftOutlined from '@ant-design/icons/lib/icons/LeftOutlined'; import RightOutlined from '@ant-design/icons/lib/icons/RightOutlined'; import { useSelector } from 'react-redux'; @@ -15,8 +15,7 @@ import { ConfirmDelete } from '../careEntry'; // import {GreenButton, StyledClose} from '../themedComponents'; import { LinkButton } from '../linkButton'; import { LIGHT_GREY, LIGHT_RED, WHITE } from '../../utils/colors'; -import protectedApiClient from "../../api/protectedApiClient"; -import {getSiteData} from "../../containers/treePage/ducks/thunks"; +import protectedApiClient from '../../api/protectedApiClient'; const CarouselContainer = styled.div` margin-top: 20px; @@ -70,8 +69,6 @@ export const DeleteSiteImageButton = styled(LinkButton)` } `; - - export const SiteImageCarousel: React.FC = () => { const { t } = useTranslation(n(site, 'treePage'), { nsMode: 'fallback' }); @@ -143,7 +140,14 @@ export const SiteImageCarousel: React.FC = () => { >

Are you sure you want to delete this image?

onClickDeleteImage(latestEntrySiteImages[currSlideIndex].imageId)}>Delete + onClick={() => + onClickDeleteImage( + latestEntrySiteImages[currSlideIndex].imageId, + ) + } + > + Delete + )}