Implemented BOD-22 removing from production board. No automation surrounding it at this time.
This commit is contained in:
@@ -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>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user