updated the component and device api's to have as be a parameter for the function
This commit is contained in:
parent
c617ebf868
commit
b62c7dbe5c
39 changed files with 346 additions and 651 deletions
|
|
@ -47,7 +47,7 @@ interface Props {
|
|||
const REQUEST_LIMIT = 25;
|
||||
|
||||
export default function AccessObject(props: Props) {
|
||||
const [{ user }, dispatch] = useGlobalState();
|
||||
const [{ user, as }, dispatch] = useGlobalState();
|
||||
// const history = useHistory();
|
||||
const navigate = useNavigate()
|
||||
const isMobile = useMobile();
|
||||
|
|
@ -152,7 +152,14 @@ export default function AccessObject(props: Props) {
|
|||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
true
|
||||
true,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
as
|
||||
)
|
||||
.then((response: any) => {
|
||||
let rDevicesOffset: number = response.data.nextOffset ? response.data.nextOffset : 0;
|
||||
|
|
@ -170,7 +177,7 @@ export default function AccessObject(props: Props) {
|
|||
setDevicesTotal(0);
|
||||
})
|
||||
.finally(() => setLoading(false));
|
||||
}, [deviceAPI, groupAPI, teamAPI, kind, searchValue]);
|
||||
}, [deviceAPI, groupAPI, teamAPI, kind, searchValue, as]);
|
||||
|
||||
const loadMoreDevices = useCallback(() => {
|
||||
deviceAPI
|
||||
|
|
@ -183,7 +190,14 @@ export default function AccessObject(props: Props) {
|
|||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
true
|
||||
true,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
as
|
||||
)
|
||||
.then((response: any) => {
|
||||
let rDevicesOffset: number = response.data.nextOffset ? response.data.nextOffset : 0;
|
||||
|
|
@ -200,7 +214,7 @@ export default function AccessObject(props: Props) {
|
|||
setDevicesOffset(0);
|
||||
setDevicesTotal(0);
|
||||
});
|
||||
}, [deviceAPI, devicesOffset, searchValue, devices]);
|
||||
}, [deviceAPI, devicesOffset, searchValue, devices, as]);
|
||||
|
||||
const loadMoreGroups = useCallback(() => {
|
||||
groupAPI
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue