Removed default CC status IO-461
This commit is contained in:
@@ -3,10 +3,7 @@ import { Select } from "antd";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
const { Option } = Select;
|
const { Option } = Select;
|
||||||
|
|
||||||
const CourtesyCarStatusComponent = (
|
const CourtesyCarStatusComponent = ({ value, onChange }, ref) => {
|
||||||
{ value = "courtesycars.status.in", onChange },
|
|
||||||
ref
|
|
||||||
) => {
|
|
||||||
const [option, setOption] = useState(value);
|
const [option, setOption] = useState(value);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
import React from "react";
|
|
||||||
import CourtesyCarFormComponent from "../../components/courtesy-car-form/courtesy-car-form.component";
|
|
||||||
|
|
||||||
export default function CourtesyCarCreateComponent({ form }) {
|
|
||||||
return <CourtesyCarFormComponent form={form} />;
|
|
||||||
}
|
|
||||||
@@ -6,7 +6,8 @@ import { connect } from "react-redux";
|
|||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { INSERT_NEW_COURTESY_CAR } from "../../graphql/courtesy-car.queries";
|
import { INSERT_NEW_COURTESY_CAR } from "../../graphql/courtesy-car.queries";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import CourtesyCarCreateComponent from "./courtesy-car-create.page.component";
|
import CourtesyCarFormComponent from "../../components/courtesy-car-form/courtesy-car-form.component";
|
||||||
|
|
||||||
import { useHistory } from "react-router-dom";
|
import { useHistory } from "react-router-dom";
|
||||||
import {
|
import {
|
||||||
setBreadcrumbs,
|
setBreadcrumbs,
|
||||||
@@ -31,17 +32,17 @@ export function CourtesyCarCreateContainer({
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
|
|
||||||
const handleFinish = (values) => {
|
const handleFinish = async (values) => {
|
||||||
insertCourtesyCar({
|
const result = await insertCourtesyCar({
|
||||||
variables: { courtesycar: { ...values, bodyshopid: bodyshop.id } },
|
variables: { courtesycar: { ...values, bodyshopid: bodyshop.id } },
|
||||||
})
|
});
|
||||||
.then((response) => {
|
|
||||||
notification["success"]({ message: t("courtesycars.successes.saved") });
|
notification["success"]({ message: t("courtesycars.successes.saved") });
|
||||||
history.push(
|
history.push(
|
||||||
`/manage/courtesycars/${response.data.insert_courtesycars.returning[0].id}`
|
`/manage/courtesycars/${result.data.insert_courtesycars.returning[0].id}`
|
||||||
);
|
);
|
||||||
})
|
|
||||||
.catch((error) => console.log("error", error));
|
console.log("error");
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -59,7 +60,7 @@ export function CourtesyCarCreateContainer({
|
|||||||
return (
|
return (
|
||||||
<RbacWrapper action="courtesycar:create">
|
<RbacWrapper action="courtesycar:create">
|
||||||
<Form form={form} autoComplete="new-password" onFinish={handleFinish}>
|
<Form form={form} autoComplete="new-password" onFinish={handleFinish}>
|
||||||
<CourtesyCarCreateComponent form={form} />
|
<CourtesyCarFormComponent form={form} />
|
||||||
</Form>
|
</Form>
|
||||||
</RbacWrapper>
|
</RbacWrapper>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user