Author SHA1 Message Date
JC Beasley 6f28a9e40c Fix: Add clearAllSurveys function that was missing 2026-07-02 15:28:12 -07:00
+21
View File
@@ -1567,7 +1567,28 @@ function confirmClearAll() {
}
}
async function clearAllSurveys() {
try {
const response = await fetch('/api/surveys', {
method: 'DELETE'
});
const data = await response.json();
if (data.success) {
showNotification('All surveys deleted successfully', 'success');
loadSurveys();
currentSurveyId = null;
currentSurvey = null;
document.getElementById('takeSurveyTab').style.display = 'none';
document.getElementById('analyzeTab').style.display = 'none';
} else {
showNotification(data.error || 'Failed to clear surveys', 'error');
}
} catch (e) {
console.error('Error clearing surveys:', e);
showNotification('Failed to clear surveys', 'error');
}
}
// Notification helper
function showNotification(message, type = 'info') {