Add UI pagination, update Redux and API service lib

This commit is contained in:
Nathan Barber
2021-05-05 18:41:48 -04:00
parent 5e2ca7bcff
commit 0439a0d274
14 changed files with 334 additions and 149 deletions

View File

@@ -3,7 +3,14 @@ import { jhapiRequest } from "./jhapiUtil";
const withAPI = withProps((props) => ({
updateUsers: (offset, limit) =>
jhapiRequest(`/users?offset=${offset}&limit=${limit}`, "GET"),
jhapiRequest(`/users?offset=${offset}&limit=${limit}`, "GET").then((data) =>
data.json()
),
updateGroups: (offset, limit) =>
jhapiRequest(
`/groups?offset=${offset}&limit=${limit}`,
"GET"
).then((data) => data.json()),
shutdownHub: () => jhapiRequest("/shutdown", "POST"),
startServer: (name) => jhapiRequest("/users/" + name + "/server", "POST"),
stopServer: (name) => jhapiRequest("/users/" + name + "/server", "DELETE"),