Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 9489 Rev 9502
Línea -... Línea 1...
-
 
1
import React, { useState, useEffect } from 'react'
1
import React from 'react'
2
import axios from 'axios'
-
 
3
 
-
 
4
const headers = [
-
 
5
  { key: "name", label: "Nombre", isSorteable: true },
-
 
6
  { key: "minimum_no_of_employee", label: "Mínimo", isSorteable: true },
-
 
7
  { key: "maximum_no_of_employee", label: "Máximo", isSorteable: true },
-
 
8
  { key: "status", label: "Activo", isSorteable: false },
-
 
9
  { key: "actions", label: "Acciones", isSorteable: false }
-
 
10
]
-
 
11
 
-
 
12
const MainView = ({ backendVars }) => {
-
 
13
 
-
 
14
  const { table_link } = backendVars
-
 
15
  const [data, setData] = useState({})
-
 
16
 
-
 
17
  const getData = ({ url = '', params = {} }) => {
-
 
18
 
-
 
19
    axios.get(url, { params: { ...params } })
-
 
20
      .then(({ data }) => {
-
 
21
        if (data.success) {
-
 
22
          setData(data.data)
-
 
23
 
-
 
24
          return data.data
-
 
25
        }
-
 
26
      })
-
 
27
      .catch((err) => console.log(err))
-
 
28
  }
-
 
29
 
-
 
30
  useEffect(() => {
-
 
31
    getData(table_link)
-
 
32
  }, [])
Línea 2... Línea -...
2
 
-
 
3
const MainView = () => {
33
 
4
  return (
34
  return (
5
    <h1>Hello</h1>
35
    <h1>Hello</h1>
6
  )
36
  )
7
}
37
}
8
export default MainView
38
export default MainView