Implemented BOD-22 removing from production board. No automation surrounding it at this time.

This commit is contained in:
Patrick Fic
2020-04-27 15:22:22 -07:00
parent f04a6fc2af
commit c3d618e239
7 changed files with 91 additions and 14 deletions

View File

@@ -0,0 +1,26 @@
import React from "react";
import { useMutation } from "@apollo/react-hooks";
import { UPDATE_JOB } from "../../graphql/jobs.queries";
import { Button, notification } from "antd";
import { useTranslation } from "react-i18next";
export default function ProductionRemoveButton({ jobId }) {
const [removeJobFromProduction] = useMutation(UPDATE_JOB);
const { t } = useTranslation();
const handleRemoveFromProd = () => {
removeJobFromProduction({
variables: { jobId: jobId, job: { inproduction: false } },
}).catch((error) => {
notification["error"]({
message: t("production.errors.removing", {
error: JSON.stringify(error),
}),
});
});
};
return (
<Button onClick={handleRemoveFromProd} type={"danger"}>
{t("production.actions.remove")}
</Button>
);
}