Resolved convert window visibility and job import error when vehicle already exists IO-426
This commit is contained in:
@@ -6,7 +6,10 @@ import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { CONVERT_JOB_TO_RO } from "../../graphql/jobs.queries";
|
||||
import { selectJobReadOnly } from "../../redux/application/application.selectors";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import {
|
||||
selectAuthLevel,
|
||||
selectBodyshop,
|
||||
} from "../../redux/user/user.selectors";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
//currentUser: selectCurrentUser
|
||||
@@ -22,16 +25,18 @@ export function JobsConvertButton({ bodyshop, job, refetch, jobRO }) {
|
||||
const [mutationConvertJob] = useMutation(CONVERT_JOB_TO_RO);
|
||||
const { t } = useTranslation();
|
||||
|
||||
const handleConvert = (values) => {
|
||||
mutationConvertJob({
|
||||
const handleConvert = async (values) => {
|
||||
const res = await mutationConvertJob({
|
||||
variables: { jobId: job.id, ...values },
|
||||
}).then((r) => {
|
||||
refetch();
|
||||
});
|
||||
|
||||
if (!res.errors) {
|
||||
refetch();
|
||||
notification["success"]({
|
||||
message: t("jobs.successes.converted"),
|
||||
});
|
||||
});
|
||||
setVisible(false);
|
||||
}
|
||||
};
|
||||
|
||||
const popMenu = (
|
||||
|
||||
Reference in New Issue
Block a user