Spaces:
Running
Running
Create admin.js
Browse files- static/js/admin.js +12 -0
static/js/admin.js
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
function seedTestData() {
|
2 |
+
apiPost('/project/seed/test_data', {})
|
3 |
+
.then(data => showResult('admin-result', data))
|
4 |
+
.catch(err => console.error(err));
|
5 |
+
}
|
6 |
+
|
7 |
+
function clearAllProjects() {
|
8 |
+
if (!confirm('Are you sure you want to clear all projects? This cannot be undone!')) return;
|
9 |
+
apiPost('/project/clear/all', {})
|
10 |
+
.then(data => showResult('admin-result', data))
|
11 |
+
.catch(err => console.error(err));
|
12 |
+
}
|