updated as in the terminal and gate api's
This commit is contained in:
parent
76744c1b6f
commit
74c8ed661c
13 changed files with 109 additions and 75 deletions
|
|
@ -10,7 +10,7 @@ import { makeStyles } from "@mui/styles";
|
|||
import ResponsiveTable, { Column } from "common/ResponsiveTable";
|
||||
import AddGateFab from "./AddGateFab";
|
||||
import GateSettings from "./GateSettings";
|
||||
import { useGateAPI } from "providers";
|
||||
import { useGateAPI, useGlobalState } from "providers";
|
||||
import { Settings } from "@mui/icons-material";
|
||||
|
||||
interface Props {
|
||||
|
|
@ -38,7 +38,8 @@ const useStyles = makeStyles((theme: Theme) => ({
|
|||
}));
|
||||
|
||||
export default function GateList(props: Props) {
|
||||
const {terminals, currentTerminal } = props;
|
||||
const {terminals, currentTerminal } = props;
|
||||
const [{as}] = useGlobalState();
|
||||
// const history = useHistory();
|
||||
const navigate = useNavigate();
|
||||
const isMobile = useMobile();
|
||||
|
|
@ -73,11 +74,11 @@ const {terminals, currentTerminal } = props;
|
|||
keys = [currentTerminal]
|
||||
types = ["terminal"]
|
||||
}
|
||||
gateAPI.listGates(pageSize, pageSize * tablePage, "asc", "name", search, undefined, keys, types).then(resp => {
|
||||
gateAPI.listGates(pageSize, pageSize * tablePage, "asc", "name", search, undefined, keys, types, undefined, undefined, as).then(resp => {
|
||||
setGates(resp.data.gates.map(gate => Gate.create(gate)))
|
||||
setTotal(resp.data.total)
|
||||
})
|
||||
},[currentTerminal, search, pageSize, tablePage])
|
||||
},[currentTerminal, search, pageSize, tablePage, as])
|
||||
|
||||
useEffect(() => {
|
||||
loadGates()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue