reload db each time

This commit is contained in:
Valentin Boettcher 2020-10-09 16:43:56 +02:00
parent 3b24875d7b
commit f5124dfaf8

View file

@ -14,6 +14,7 @@ function setUpForm() {
$('#verts').append(`
<h4>${vert}</h4>
`);
for(let sub of subjects[vert].keys()) {
$('#verts').append(`
@ -41,8 +42,6 @@ async function renderTable() {
if(types.length === 0)
types = ['tut', 'lect'];
console.log( types.lenght );
week = $('#week').val();
allsub = [];
@ -88,7 +87,10 @@ async function renderTable() {
}
$(document).ready(() => {
getEvents().then(events => {
db.allDocs({include_docs: true}).then(({rows}) => {
return Promise.all(rows.map(row => db.remove(row.doc)));
}).then(() =>
getEvents()).then(events => {
allput=[];
for(let event of events) {
if(!subjects[event.vert_name])