Skip to content

Commit

Permalink
Liten fix paa stort problem
Browse files Browse the repository at this point in the history
  • Loading branch information
betsytraran committed Apr 4, 2024
1 parent f9b7d71 commit adb31ad
Showing 1 changed file with 19 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,33 @@ export default () => {
}, [request])

useEffect(() => {
if (response && state.personListe?.length === 0) {
if (response?.data?.data?.personer?.length === 0) {
setState({
...state,
personListe: response?.data?.data?.personer,
seed: response?.data?.data?.seed,
personListe: [],
nesteSide: response?.data?.data?.nesteSide,
})
} else if (
state.personListe?.length > 0 &&
response?.data?.data?.personer?.length > 0 &&
state.side > 0
) {
} else if (response && state.personListe?.length === 0) {
setState({
...state,
personListe: [...state.personListe, ...response?.data?.data?.personer],
personListe: response?.data?.data?.personer,
seed: response?.data?.data?.seed,
nesteSide: response?.data?.data?.nesteSide,
})
} else if (state.personListe?.length > 0 && response?.data?.data?.personer?.length > 0) {
if (state.side > 0) {
setState({
...state,
personListe: [...state.personListe, ...response?.data?.data?.personer],
nesteSide: response?.data?.data?.nesteSide,
})
} else {
setState({
...state,
personListe: response?.data?.data?.personer,
nesteSide: response?.data?.data?.nesteSide,
})
}
}
}, [response])

Expand Down

0 comments on commit adb31ad

Please sign in to comment.