pull/22878/head
leslie2046 12 months ago
parent 30159a4677
commit 9147a1a179

@ -79,15 +79,17 @@ const HeaderOptions: FC<Props> = ({
const [showBulkImportModal, setShowBulkImportModal] = useState(false)
const handleClearAll = async () => {
await confirm({
const isConfirmed= await confirm({
title: t('appAnnotation.table.header.clearAllConfirm'),
type: 'danger',
})
try {
await clearAllAnnotations(appId)
onAdded()
} catch (e) {
if(isConfirmed){
try {
await clearAllAnnotations(appId)
onAdded()
} catch (e) {
console.error(e)
}
}
}
const Operations = () => {

@ -65,5 +65,5 @@ export const fetchHitHistoryList = (appId: string, annotationId: string, params:
}
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