mirror of
https://gitlab.com/MrFry/qmining-page
synced 2026-04-28 03:07:36 +02:00
Removed .Subjects to work with new data structure
This commit is contained in:
@@ -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
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user