diff --git a/app/components/general/AddStakeholderModal/StakeholderList/StakeholderRow/index.tsx b/app/components/general/AddStakeholderModal/StakeholderList/StakeholderRow/index.tsx index 1f77066b7a..659c0b9152 100644 --- a/app/components/general/AddStakeholderModal/StakeholderList/StakeholderRow/index.tsx +++ b/app/components/general/AddStakeholderModal/StakeholderList/StakeholderRow/index.tsx @@ -1,4 +1,4 @@ -import React, { useCallback } from 'react'; +import React from 'react'; import { IoClose } from 'react-icons/io5'; import { QuickActionButton, @@ -7,7 +7,7 @@ import { export interface Props { className?: string; - onRemove: (index: string) => void; + onRemove: (value: string) => void; value: string; displayValue?: string; } @@ -20,18 +20,14 @@ function StakeholderRow(props: Props) { displayValue, } = props; - const handleClick = useCallback(() => { - onRemove(value); - }, [value, onRemove]); - return (
diff --git a/app/components/general/AddStakeholderModal/StakeholderList/index.tsx b/app/components/general/AddStakeholderModal/StakeholderList/index.tsx index 603eb05382..272499ea42 100644 --- a/app/components/general/AddStakeholderModal/StakeholderList/index.tsx +++ b/app/components/general/AddStakeholderModal/StakeholderList/index.tsx @@ -78,7 +78,7 @@ function StakeholderList(props: Props) { const onRowRemove = useCallback((id: string) => { if (value) { - onChange(value.filter((v) => v.organization !== id), name); + onChange(value.filter((v) => v.clientId !== id), name); } }, [value, name, onChange]); diff --git a/app/views/EditAry/AssessmentRegistryForm/AdditionalDocument/FileUpload/index.tsx b/app/views/EditAry/AssessmentRegistryForm/AdditionalDocument/FileUpload/index.tsx index 1e89cb4351..1413f36090 100644 --- a/app/views/EditAry/AssessmentRegistryForm/AdditionalDocument/FileUpload/index.tsx +++ b/app/views/EditAry/AssessmentRegistryForm/AdditionalDocument/FileUpload/index.tsx @@ -55,6 +55,11 @@ function FileUpload(props: Props) { }), [handleFileRemove, uploadedList], ); + const handleExternalLinkChange = useCallback((newLink: string | undefined) => { + setExternalLink(newLink); + setURLError(undefined); + }, []); + const handleExternalLinkAdd = useCallback(() => { const isUrl = isValidUrl(externalLink ?? ''); if (!isUrl) { @@ -68,11 +73,11 @@ function FileUpload(props: Props) { documentType: name, externalLink, }); - setExternalLink(undefined); + handleExternalLinkChange(undefined); }, [ name, externalLink, - setExternalLink, + handleExternalLinkChange, onSuccess, ]); @@ -100,7 +105,7 @@ function FileUpload(props: Props) { placeholder="External Link" name="externalLink" value={externalLink} - onChange={setExternalLink} + onChange={handleExternalLinkChange} error={urlError} />