IO-899 WIP CC Improvements
This commit is contained in:
@@ -6,7 +6,7 @@ import { alphaSort } from "../../utils/sorters";
|
||||
export default function ContractsCarsComponent({
|
||||
loading,
|
||||
data,
|
||||
selectedCar,
|
||||
selectedCarId,
|
||||
handleSelect,
|
||||
}) {
|
||||
const [state, setState] = useState({
|
||||
@@ -117,7 +117,7 @@ export default function ContractsCarsComponent({
|
||||
rowSelection={{
|
||||
onSelect: handleSelect,
|
||||
type: "radio",
|
||||
selectedRowKeys: [selectedCar],
|
||||
selectedRowKeys: [selectedCarId],
|
||||
}}
|
||||
onRow={(record, rowIndex) => {
|
||||
return {
|
||||
|
||||
@@ -13,12 +13,13 @@ export default function ContractCarsContainer({ selectedCarState, form }) {
|
||||
const [selectedCar, setSelectedCar] = selectedCarState;
|
||||
|
||||
const handleSelect = (record) => {
|
||||
setSelectedCar(record.id);
|
||||
setSelectedCar(record);
|
||||
|
||||
form.setFieldsValue({
|
||||
kmstart: record.mileage,
|
||||
dailyrate: record.dailycost,
|
||||
fuelout: record.fuel,
|
||||
damage: record.damage,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -26,7 +27,7 @@ export default function ContractCarsContainer({ selectedCarState, form }) {
|
||||
return (
|
||||
<ContractCarsComponent
|
||||
handleSelect={handleSelect}
|
||||
selectedCar={selectedCar}
|
||||
selectedCarId={selectedCar && selectedCar.id}
|
||||
loading={loading}
|
||||
data={data ? data.courtesycars : []}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user