Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6f28a9e40c |
+22
-1
@@ -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
|
// Notification helper
|
||||||
function showNotification(message, type = 'info') {
|
function showNotification(message, type = 'info') {
|
||||||
|
|||||||
Reference in New Issue
Block a user