Added base owners list page.
This commit is contained in:
20
client/src/components/owners-list/owners-list.container.jsx
Normal file
20
client/src/components/owners-list/owners-list.container.jsx
Normal 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}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user