Data loading changes

This commit is contained in:
mrfry 2021-01-08 12:45:15 +01:00
parent 98b12f523e
commit bf4bdfb249
3 changed files with 7 additions and 6 deletions

View file

@ -94,7 +94,6 @@ function GetApp(): ModuleType {
}
// files in public dirs
const questionDbsDir = publicDir + 'questionDbs'
const dbsFile = publicDir + 'questionDbs.json'
const savedQuestionsDir = publicDir + 'savedQuestions'
const recivedFiles = publicDir + 'recivedfiles'
@ -147,7 +146,7 @@ function GetApp(): ModuleType {
})
)
const questionDbs = loadJSON(dataFiles, questionDbsDir)
const questionDbs = loadJSON(dataFiles, publicDir)
let version = ''
let rootRedirectURL = ''
let motd = ''
@ -289,7 +288,7 @@ function GetApp(): ModuleType {
res.json(
dataFiles.map((df) => {
return {
path: df.path.split('/').pop(),
path: df.path,
name: df.name,
}
})
@ -1051,7 +1050,6 @@ function GetApp(): ModuleType {
function saveQuestion(questions, subj, location, userid) {
// TODO: clear folder every now and then, check if saved questions exist
// TODO: group questions by suject
const questionsToSave = {
questions: questions,
subj: subj,

View file

@ -143,10 +143,13 @@ function GetApp(): ModuleType {
to: '/',
},
{
// to be backwards compatible
from: '/legacy',
to: '/allQuestions.html',
},
{
from: '/subjectBrowser',
to: '/allQuestions.html',
},
{
from: '/lred',
to: '/allQuestions',

@ -1 +1 @@
Subproject commit d798a8322d33cdaf0b38771f78a5fb7b7207eefc
Subproject commit 5a1bd258bcdeba3f268c802fe1a81632ce57f035