Merge branch 'main' of https://floke-gitea.duckdns.org/Floke/Brancheneinstufung2
# Conflicts: # company-explorer/frontend/src/components/Inspector.tsx # company-explorer/frontend/src/components/RoboticsSettings.tsx
This commit is contained in:
@@ -296,15 +296,7 @@ export function Inspector({ companyId, initialContactId, onClose, apiBase }: Ins
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleLockToggle = async (sourceType: string, currentLockStatus: boolean) => {
|
const handleLockToggle = async (sourceType: string, currentLockStatus: boolean) => {\n if (!companyId) return\n try {\n await axios.post(`${apiBase}/enrichment/${companyId}/${sourceType}/lock?locked=${!currentLockStatus}`)\n fetchData(true) // Silent refresh\n } catch (e) {\n console.error(\"Lock toggle failed\", e)\n }\n }\n\n // NEW: Interface for reporting mistakes\n interface ReportedMistakeRequest {\n field_name: string;\n wrong_value?: string | null;\n corrected_value?: string | null;\n source_url?: string | null;\n quote?: string | null;\n user_comment?: string | null;\n }\n\n const handleReportMistake = async () => {\n if (!companyId) return;\n if (!reportedFieldName) {\n alert(\"Field Name is required.\");\n return;\n }\n\n setIsProcessing(true);\n try {\n const payload: ReportedMistakeRequest = {\n field_name: reportedFieldName,\n wrong_value: reportedWrongValue || null,\n corrected_value: reportedCorrectedValue || null,\n source_url: reportedSourceUrl || null,\n quote: reportedQuote || null,\n user_comment: reportedComment || null,\n };\n\n await axios.post(`${apiBase}/companies/${companyId}/report-mistake`, payload);\n alert(\"Mistake reported successfully!\");\n setIsReportingMistake(false);\n // Reset form fields\n setReportedFieldName(\"\");\n setReportedWrongValue(\"\");\ setReportedCorrectedValue(\"\");\n setReportedSourceUrl(\"\");\n setReportedQuote(\"\");\n setReportedComment(\"\");\n } catch (e) {\n alert(\"Failed to report mistake.\");\n console.error(e);\n } finally {\n setIsProcessing(false);\n }\n };
|
||||||
if (!companyId) return
|
|
||||||
try {
|
|
||||||
await axios.post(`${apiBase}/enrichment/${companyId}/${sourceType}/lock?locked=${!currentLockStatus}`)
|
|
||||||
fetchData(true) // Silent refresh
|
|
||||||
} catch (e) {
|
|
||||||
console.error("Lock toggle failed", e)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// NEW: Interface for reporting mistakes
|
// NEW: Interface for reporting mistakes
|
||||||
interface ReportedMistakeRequest {
|
interface ReportedMistakeRequest {
|
||||||
@@ -1110,7 +1102,7 @@ export function Inspector({ companyId, initialContactId, onClose, apiBase }: Ins
|
|||||||
placeholder="e.g., Impressum City"
|
placeholder="e.g., Impressum City"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div>
|
<div>
|
||||||
<label htmlFor="wrongValue" className="block text-xs font-medium text-slate-700 dark:text-slate-300">Currently Displayed Value (Optional)</label>
|
<label htmlFor="wrongValue" className="block text-xs font-medium text-slate-700 dark:text-slate-300">Currently Displayed Value (Optional)</label>
|
||||||
<input
|
<input
|
||||||
|
|||||||
Reference in New Issue
Block a user