Added association tracking
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import React from "react";
|
||||
import { useQuery } from "react-apollo";
|
||||
import { QUERY_ALL_ASSOCIATIONS } from "../../graphql/associations.queries";
|
||||
import AlertComponent from "../alert/alert.component";
|
||||
import ProfileShopsComponent from "./profile-shops.component";
|
||||
|
||||
export default function ProfileShopsContainer() {
|
||||
|
||||
const { loading, error, data, refetch } = useQuery(QUERY_ALL_ASSOCIATIONS);
|
||||
|
||||
const updateActiveShop = activeShopId => {
|
||||
console.log("activeShopId", activeShopId);
|
||||
refetch();
|
||||
};
|
||||
|
||||
if (error) return <AlertComponent type="error" message={error.message} />;
|
||||
return (
|
||||
<ProfileShopsComponent
|
||||
loading={loading}
|
||||
data={data ? data.associations : null}
|
||||
updateActiveShop={updateActiveShop}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user