mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Fixed api getinfos
This commit is contained in:
@@ -823,15 +823,16 @@ function GetApp() {
|
||||
})
|
||||
|
||||
function getSimplreRes() {
|
||||
console.log(data)
|
||||
return {
|
||||
subjects: data.length,
|
||||
questions: data.Subjects.reduce((acc, subj) => {
|
||||
questions: data.reduce((acc, subj) => {
|
||||
return acc + subj.length
|
||||
}, 0),
|
||||
}
|
||||
}
|
||||
function getDetailedRes() {
|
||||
return data.Subjects.map((subj) => {
|
||||
return data.map((subj) => {
|
||||
return {
|
||||
name: subj.Name,
|
||||
count: subj.length,
|
||||
@@ -887,8 +888,8 @@ function GetApp() {
|
||||
utils.AppendToFile(
|
||||
JSON.stringify({
|
||||
date: utils.GetDateString(),
|
||||
subjectCount: data.Subjects.length,
|
||||
questionCOunt: data.Subjects.reduce((acc, subj) => {
|
||||
subjectCount: data.length,
|
||||
questionCOunt: data.reduce((acc, subj) => {
|
||||
return acc + subj.Questions.length
|
||||
}, 0),
|
||||
userCount: dbtools.TableInfo(userDB, 'users').dataCount,
|
||||
|
Reference in New Issue
Block a user