separate page change from other sort/filter options.

master
sigonasr2, Sig, Sigo 3 years ago
parent c8552be8b6
commit 8607eda1f8
  1. 17
      src/Builds.js

@ -59,6 +59,7 @@ function Builds(p) {
useEffect(()=>{ useEffect(()=>{
setFinished(false) setFinished(false)
setPage(0)
axios.get(`${BACKENDURL}/getBuilds?sort_type=${sort}${filter_type!==""?`&filter_type=${filter_type}`:""}${filter_type!==""?`&filter=${encodeURI(filter)}`:""}${page!==0?`&offset=${page}`:""}`) axios.get(`${BACKENDURL}/getBuilds?sort_type=${sort}${filter_type!==""?`&filter_type=${filter_type}`:""}${filter_type!==""?`&filter=${encodeURI(filter)}`:""}${page!==0?`&offset=${page}`:""}`)
.then((data)=>{ .then((data)=>{
setBuilds(data.data) setBuilds(data.data)
@ -69,7 +70,21 @@ function Builds(p) {
.finally(()=>{ .finally(()=>{
setFinished(true) setFinished(true)
}) })
},[BACKENDURL,sort,filter_type,filter,page]) },[BACKENDURL,sort,filter_type,filter])
useEffect(()=>{
setFinished(false)
axios.get(`${BACKENDURL}/getBuilds?sort_type=${sort}${filter_type!==""?`&filter_type=${filter_type}`:""}${filter_type!==""?`&filter=${encodeURI(filter)}`:""}${page!==0?`&offset=${page}`:""}`)
.then((data)=>{
setBuilds(data.data)
})
.catch((err)=>{
})
.finally(()=>{
setFinished(true)
})
},[page])
return <> return <>
<div className="box skillTreeBox"> <div className="box skillTreeBox">

Loading…
Cancel
Save