🚧 back to working query params
Co-authored-by: Sindre Kjelsrud <kjelsrudsindre@gmail.com>
This commit is contained in:
parent
20aaef67d7
commit
a4c06834e4
3 changed files with 9 additions and 8 deletions
|
|
@ -4,7 +4,7 @@ import q from 'qjuul'
|
|||
import { MovieForm, Pagination, MovieTable, MovieModal } from './components'
|
||||
import type { movieObject } from './types/movie'
|
||||
import { fetchMovie } from './api/fetchMovie'
|
||||
import { useLocation } from 'react-router'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
|
||||
function App() {
|
||||
const [movies, setMovies] = useState<movieObject[]>([])
|
||||
|
|
@ -22,6 +22,7 @@ function App() {
|
|||
if (response.Response == 'True') {
|
||||
setMovies(response.Search)
|
||||
setTotalPages(Number(response.totalResults))
|
||||
setCurrentPage(Number(page))
|
||||
setLoading(false)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue