Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 1185 Rev 1186
Línea 62... Línea 62...
62
    history.replace(`${pathname}?${params.toString()}`)
62
    history.replace(`${pathname}?${params.toString()}`)
63
  }
63
  }
Línea 64... Línea 64...
64
 
64
 
65
  useEffect(() => {
65
  useEffect(() => {
66
    const searchEntities = async () => {
-
 
67
      setLoading(true)
-
 
68
 
66
    const searchEntities = async () => {
69
      try {
67
      try {
70
        const date = new Date().getTime()
68
        const date = new Date().getTime()
71
        const { data: responseData } = await axios.get(
69
        const { data: responseData } = await axios.get(
72
          `search/entity/group?page=1&t${date}`
70
          `search/entity/group?page=1&t${date}`
Línea 80... Línea 78...
80
        console.log(data)
78
        console.log(data)
81
        setEntities(data.current.items)
79
        setEntities(data.current.items)
82
        setPages(data.total.pages)
80
        setPages(data.total.pages)
83
      } catch (error) {
81
      } catch (error) {
84
        dispatch(addNotification({ style: 'danger', msg: error.message }))
82
        dispatch(addNotification({ style: 'danger', msg: error.message }))
85
      } finally {
-
 
86
        setLoading(false)
-
 
87
      }
83
      }
88
    }
84
    }
Línea 89... Línea 85...
89
 
85
 
90
    searchEntities()
86
    searchEntities()
Línea 112... Línea 108...
112
            </FiltersSidebar>
108
            </FiltersSidebar>
113
          </Grid>
109
          </Grid>
Línea 114... Línea 110...
114
 
110
 
115
          <Grid item xs={12} md={8} display='flex' direction='column' gap={2}>
111
          <Grid item xs={12} md={8} display='flex' direction='column' gap={2}>
116
            <div className='posts-section'>
-
 
117
              {loading ? (
-
 
118
                <LoaderContainer>
-
 
119
                  <Spinner />
-
 
120
                </LoaderContainer>
-
 
121
              ) : (
-
 
122
                <>
112
            <div className='posts-section'>
123
                  <EntitiesList entities={entities} />
113
              <EntitiesList entities={entities} />
124
                  <PaginationComponent
114
              <PaginationComponent
125
                    pages={pages}
115
                pages={pages}
126
                    currentActivePage={currentPage}
116
                currentActivePage={currentPage}
127
                    onChangePage={onChangePage}
117
                onChangePage={onChangePage}
128
                    isRow
-
 
129
                  />
-
 
130
                </>
118
                isRow
131
              )}
119
              />
132
            </div>
120
            </div>
133
          </Grid>
121
          </Grid>
134
        </Grid>
122
        </Grid>
135
      </Container>
123
      </Container>