Added messaging presets BOD-107

This commit is contained in:
Patrick Fic
2020-07-21 16:12:32 -07:00
parent 0ef4d77275
commit 7b99a2e612
21 changed files with 526 additions and 18 deletions

View File

@@ -13,25 +13,24 @@ export default function ShopInfoContainer() {
const { t } = useTranslation();
const [updateBodyshop] = useMutation(UPDATE_SHOP);
const { loading, error, data, refetch } = useQuery(QUERY_BODYSHOP, {
fetchPolicy: "network-only"
fetchPolicy: "network-only",
});
const handleFinish = values => {
const handleFinish = (values) => {
console.log("values", values);
logImEXEvent("shop_update");
updateBodyshop({
variables: { id: data.bodyshops[0].id, shop: values }
variables: { id: data.bodyshops[0].id, shop: values },
})
.then(r => {
.then((r) => {
notification["success"]({ message: t("bodyshop.successes.save") });
refetch().then(_ => form.resetFields());
refetch().then((_) => form.resetFields());
})
.catch(error => {
notification["error"](
{ message: t("bodyshop.errors.saving") },
{ message: error }
);
.catch((error) => {
notification["error"]({
message: t("bodyshop.errors.saving", { message: error }),
});
});
};