Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 7014 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 7014 Rev 7040
Línea 26... Línea 26...
26
  const history = useHistory()
26
  const history = useHistory()
Línea 27... Línea 27...
27
 
27
 
28
  const params = new URLSearchParams(search)
28
  const params = new URLSearchParams(search)
Línea 29... Línea 29...
29
  const keyword = params.get('keyword')
29
  const keyword = params.get('keyword')
30
 
30
 
31
  const loadEntities = async (page = 1) => {
31
  const loadEntities = async (page = 1, keyword = '', category = 'user') => {
Línea 32... Línea 32...
32
    setLoading(true)
32
    setLoading(true)
Línea 142... Línea 142...
142
    setCategory(newCategory)
142
    setCategory(newCategory)
143
    history.push(`/search/entity/${newCategory}?${jsonToParams(urlParams)}`)
143
    history.push(`/search/entity/${newCategory}?${jsonToParams(urlParams)}`)
144
  }
144
  }
Línea 145... Línea 145...
145
 
145
 
146
  useEffect(() => {
146
  useEffect(() => {
147
    loadEntities()
147
    loadEntities(currentPage, keyword, category)
148
    setEntity(keyword)
148
    setEntity(keyword)
149
    return () => {
149
    return () => {
150
      setCategory('user')
150
      setCategory('user')
151
      setEntity('')
151
      setEntity('')
152
      activeFilters.current = []
152
      activeFilters.current = []
153
      addressKeys.current = []
153
      addressKeys.current = []
154
    }
154
    }
Línea 155... Línea 155...
155
  }, [keyword, category])
155
  }, [keyword, category, currentPage])
156
 
156
 
157
  return (
157
  return (
158
    <>
158
    <>