mirror of
https://gitlab.com/MrFry/qmining-page
synced 2025-04-01 20:23:44 +02:00
Removed .Subjects to work with new data structure
This commit is contained in:
parent
7ac65348e4
commit
d523d50fa1
4 changed files with 15 additions and 9 deletions
|
@ -27,15 +27,15 @@ export default function SubjectBrowser (props) {
|
|||
})
|
||||
.then((data) => {
|
||||
setData(data)
|
||||
setSCount(data.Subjects.length)
|
||||
setQCount(data.Subjects.reduce((acc, subj) => {
|
||||
setSCount(data.length)
|
||||
setQCount(data.reduce((acc, subj) => {
|
||||
return acc + subj.Questions.length
|
||||
}, 0))
|
||||
})
|
||||
}, [])
|
||||
|
||||
if (data) {
|
||||
let currSubj = data.Subjects.find((subj) => {
|
||||
let currSubj = data.find((subj) => {
|
||||
return subj.Name === activeSubjName
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue