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() {
|
||||
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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue