Add persistent URL / stateful pagination for users

This commit is contained in:
Nathan Barber
2021-05-05 12:55:36 -04:00
parent 144a018705
commit f1ddb58d7d
5 changed files with 65 additions and 12 deletions

View File

@@ -2,7 +2,8 @@ import { withProps } from "recompose";
import { jhapiRequest } from "./jhapiUtil";
const withAPI = withProps((props) => ({
updateUsers: (cb) => jhapiRequest("/users", "GET"),
updateUsers: (offset, limit) =>
jhapiRequest(`/users?offset=${offset}&limit=${limit}`, "GET"),
shutdownHub: () => jhapiRequest("/shutdown", "POST"),
startServer: (name) => jhapiRequest("/users/" + name + "/server", "POST"),
stopServer: (name) => jhapiRequest("/users/" + name + "/server", "DELETE"),