mirror of
https://gitlab.com/MrFry/qmining-data-editor
synced 2025-04-01 20:24:01 +02:00
Not forgetting search term on refresh, remove .ind parameter from data
This commit is contained in:
parent
760dfb0c4e
commit
3940800ace
2 changed files with 18 additions and 13 deletions
|
@ -5,7 +5,7 @@ import QuestionSearchResult from '../components/QuestionSearchResult.js'
|
|||
|
||||
import styles from './questionView.module.css'
|
||||
|
||||
export default function questionView (props) {
|
||||
export default function questionView(props) {
|
||||
const { data, onChange, deleteQuestion } = props
|
||||
const [searchTerm, setSearchTerm] = useState('')
|
||||
|
||||
|
@ -14,11 +14,13 @@ export default function questionView (props) {
|
|||
<div>
|
||||
<div className={styles.searchContainer}>
|
||||
<input
|
||||
placeholder='Keresés...'
|
||||
placeholder="Keresés..."
|
||||
className={styles.searchBar}
|
||||
type='text'
|
||||
type="text"
|
||||
value={searchTerm}
|
||||
onChange={(e) => { setSearchTerm(e.target.value) }}
|
||||
onChange={(e) => {
|
||||
setSearchTerm(e.target.value)
|
||||
}}
|
||||
/>
|
||||
<button
|
||||
onClick={() => {
|
||||
|
@ -41,8 +43,6 @@ export default function questionView (props) {
|
|||
</div>
|
||||
)
|
||||
} else {
|
||||
return (
|
||||
<LoadingIndicator />
|
||||
)
|
||||
return <LoadingIndicator />
|
||||
}
|
||||
}
|
||||
|
|
|
@ -108,6 +108,14 @@ export default function Index(props) {
|
|||
alert('Adatok már feltöltés alatt, várd meg míg feltölti') // eslint-disable-line
|
||||
return
|
||||
}
|
||||
|
||||
data.forEach((subj) => {
|
||||
delete subj.ind
|
||||
subj.Questions.forEach((question) => {
|
||||
delete question.ind
|
||||
})
|
||||
})
|
||||
|
||||
setSending(true)
|
||||
try {
|
||||
const rawResponse = await fetch(constants.apiUrl + 'uploaddata', {
|
||||
|
@ -178,7 +186,8 @@ export default function Index(props) {
|
|||
<div className={styles.welcome}>
|
||||
Kérdés szerkesztő
|
||||
<br />
|
||||
{initialCount.questionCount} kérdés, {initialCount.subjectCount} tárgy
|
||||
{initialCount.questionCount || '...'} kérdés,{' '}
|
||||
{initialCount.subjectCount || '...'} tárgy
|
||||
<p />
|
||||
Itt az éles adatbázis kérdései jelennek meg, amiket tudsz
|
||||
szerkeszteni. A kérdésekhez tartozó '.data' prop-ot még nem tudod
|
||||
|
@ -197,10 +206,6 @@ export default function Index(props) {
|
|||
}
|
||||
}
|
||||
|
||||
if (!data) {
|
||||
return <LoadingIndicator />
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className={styles.optionsButtonContainer}>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue