pull/22878/head
leslie2046 1 year ago
parent 30159a4677
commit 9147a1a179

@ -79,10 +79,11 @@ const HeaderOptions: FC<Props> = ({
const [showBulkImportModal, setShowBulkImportModal] = useState(false) const [showBulkImportModal, setShowBulkImportModal] = useState(false)
const handleClearAll = async () => { const handleClearAll = async () => {
await confirm({ const isConfirmed= await confirm({
title: t('appAnnotation.table.header.clearAllConfirm'), title: t('appAnnotation.table.header.clearAllConfirm'),
type: 'danger', type: 'danger',
}) })
if(isConfirmed){
try { try {
await clearAllAnnotations(appId) await clearAllAnnotations(appId)
onAdded() onAdded()
@ -90,6 +91,7 @@ const HeaderOptions: FC<Props> = ({
console.error(e) console.error(e)
} }
} }
}
const Operations = () => { const Operations = () => {
return ( return (
<div className="w-full py-1"> <div className="w-full py-1">

@ -65,5 +65,5 @@ export const fetchHitHistoryList = (appId: string, annotationId: string, params:
} }
export const clearAllAnnotations = (appId: string): Promise<any> => { export const clearAllAnnotations = (appId: string): Promise<any> => {
return post(`apps/${appId}/annotations/${annotationId}/clear-all`) return post(`apps/${appId}/annotations/clear-all`)
} }

Loading…
Cancel
Save