Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 9489 | Rev 9506 | Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |

import React, { useState, useEffect } from 'react'
import axios from 'axios'

const headers = [
  { key: "name", label: "Nombre", isSorteable: true },
  { key: "minimum_no_of_employee", label: "Mínimo", isSorteable: true },
  { key: "maximum_no_of_employee", label: "Máximo", isSorteable: true },
  { key: "status", label: "Activo", isSorteable: false },
  { key: "actions", label: "Acciones", isSorteable: false }
]

const MainView = ({ backendVars }) => {

  const { table_link } = backendVars
  const [data, setData] = useState({})

  const getData = ({ url = '', params = {} }) => {

    axios.get(url, { params: { ...params } })
      .then(({ data }) => {
        if (data.success) {
          setData(data.data)

          return data.data
        }
      })
      .catch((err) => console.log(err))
  }

  useEffect(() => {
    getData(table_link)
  }, [])

  return (
    <h1>Hello</h1>
  )
}
export default MainView