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:
parent
46ce575bb0
commit
13dea517d4
1 changed files with 5 additions and 4 deletions
|
@ -823,15 +823,16 @@ function GetApp() {
|
||||||
})
|
})
|
||||||
|
|
||||||
function getSimplreRes() {
|
function getSimplreRes() {
|
||||||
|
console.log(data)
|
||||||
return {
|
return {
|
||||||
subjects: data.length,
|
subjects: data.length,
|
||||||
questions: data.Subjects.reduce((acc, subj) => {
|
questions: data.reduce((acc, subj) => {
|
||||||
return acc + subj.length
|
return acc + subj.length
|
||||||
}, 0),
|
}, 0),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function getDetailedRes() {
|
function getDetailedRes() {
|
||||||
return data.Subjects.map((subj) => {
|
return data.map((subj) => {
|
||||||
return {
|
return {
|
||||||
name: subj.Name,
|
name: subj.Name,
|
||||||
count: subj.length,
|
count: subj.length,
|
||||||
|
@ -887,8 +888,8 @@ function GetApp() {
|
||||||
utils.AppendToFile(
|
utils.AppendToFile(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
date: utils.GetDateString(),
|
date: utils.GetDateString(),
|
||||||
subjectCount: data.Subjects.length,
|
subjectCount: data.length,
|
||||||
questionCOunt: data.Subjects.reduce((acc, subj) => {
|
questionCOunt: data.reduce((acc, subj) => {
|
||||||
return acc + subj.Questions.length
|
return acc + subj.Questions.length
|
||||||
}, 0),
|
}, 0),
|
||||||
userCount: dbtools.TableInfo(userDB, 'users').dataCount,
|
userCount: dbtools.TableInfo(userDB, 'users').dataCount,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue