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
|
@ -17,7 +17,7 @@ class QuestionSearchResult extends PureComponent {
|
|||
}
|
||||
|
||||
if (searchTerm) {
|
||||
subjs = data.Subjects.reduce((acc, subj) => {
|
||||
subjs = data.reduce((acc, subj) => {
|
||||
const resultQuestions = subj.Questions.reduce((qacc, question) => {
|
||||
const keys = [ 'Q', 'A', 'data' ]
|
||||
keys.some((key) => {
|
||||
|
@ -41,14 +41,14 @@ class QuestionSearchResult extends PureComponent {
|
|||
}, [])
|
||||
results = subjs.reduce(countReducer, 0)
|
||||
} else {
|
||||
results = data.Subjects.reduce(countReducer, 0)
|
||||
results = data.reduce(countReducer, 0)
|
||||
}
|
||||
|
||||
const renderCount = () => {
|
||||
return (
|
||||
<div>
|
||||
<div>
|
||||
{searchTerm ? '' : 'Kezdj el írni kereséshez!'} {results} {searchTerm ? 'találat' : 'kérdés' } {searchTerm ? subjs.length : data.Subjects.length} tárgy
|
||||
{searchTerm ? '' : 'Kezdj el írni kereséshez!'} {results} {searchTerm ? 'találat' : 'kérdés' } {searchTerm ? subjs.length : data.length} tárgy
|
||||
</div>
|
||||
<Sleep />
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue