mirror of
https://github.com/vale981/vertiefungs_scraper
synced 2025-03-04 17:21:38 -05:00
reload db each time
This commit is contained in:
parent
3b24875d7b
commit
f5124dfaf8
1 changed files with 5 additions and 3 deletions
8
main.js
8
main.js
|
@ -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])
|
||||
|
|
Loading…
Add table
Reference in a new issue