Added base owners list page.

This commit is contained in:
Patrick Fic
2020-02-10 09:05:33 -08:00
parent a3c66866d3
commit cef294b65f
8 changed files with 186 additions and 7 deletions

View File

@@ -0,0 +1,20 @@
import React from "react";
import OwnersListComponent from "./owners-list.component";
import { useQuery } from "react-apollo";
import AlertComponent from "../alert/alert.component";
import { QUERY_ALL_OWNERS } from "../../graphql/owners.queries";
export default function OwnersListContainer() {
const { loading, error, data, refetch } = useQuery(QUERY_ALL_OWNERS, {
fetchPolicy: "network-only"
});
if (error) return <AlertComponent message={error.message} type="error" />;
return (
<OwnersListComponent
loading={loading}
owners={data ? data.owners : null}
refetch={refetch}
/>
);
}