File tree Expand file tree Collapse file tree 4 files changed +12
-6
lines changed Expand file tree Collapse file tree 4 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -226,7 +226,7 @@ const AdvVehicleFields: React.FunctionComponent<FormProps> = ({
226
226
</ div >
227
227
{ config ?. data &&
228
228
config . data . map ( ( { key, list } ) => (
229
- < ItemDropDown title = { t ( `label.${ key } ` ) } >
229
+ < ItemDropDown title = { t ( `label.${ key } ` ) } key = { key } >
230
230
{ map ( list , ( item ) => (
231
231
/* @ts -ignore */
232
232
< Detail key = { item . key } item = { item } />
Original file line number Diff line number Diff line change 1
1
/* eslint-disable no-param-reassign */
2
2
import React , { memo , forwardRef } from 'react'
3
3
import PropTypes from 'prop-types'
4
+ import omit from 'lodash/omit'
4
5
import toNumber from 'lodash/toNumber'
5
6
import classNames from 'classnames'
6
7
import styles from './Input.module.scss'
@@ -45,7 +46,7 @@ const BaseInput = forwardRef(
45
46
const isTextAreaInput = type === 'textarea'
46
47
47
48
const inputProps = {
48
- ...rest ,
49
+ ...omit ( rest , [ 'loading' ] ) ,
49
50
id : hasLabel ? name : null ,
50
51
disabled,
51
52
type,
Original file line number Diff line number Diff line change @@ -49,7 +49,6 @@ const SelectComponent = ({
49
49
if ( input . onChange ) input . onChange ( val )
50
50
if ( onChange ) onChange ( val )
51
51
}
52
-
53
52
const Title = ( ) => {
54
53
const title =
55
54
get (
@@ -188,7 +187,7 @@ const SelectComponent = ({
188
187
189
188
SelectComponent . propTypes = {
190
189
disabled : PropTypes . bool ,
191
- options : PropTypes . objectOf ( PropTypes . any ) ,
190
+ options : PropTypes . any ,
192
191
className : PropTypes . string ,
193
192
name : PropTypes . string ,
194
193
onChange : PropTypes . func ,
@@ -283,7 +282,7 @@ export default Select
283
282
284
283
Select . propTypes = {
285
284
visible : PropTypes . bool ,
286
- options : PropTypes . objectOf ( PropTypes . any ) , // { key: { label: string, value: 1 }}
285
+ options : PropTypes . any , // { key: { label: string, value: 1 }}
287
286
className : PropTypes . string ,
288
287
disabled : PropTypes . bool ,
289
288
name : PropTypes . string ,
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ function* handleCreateListing(action) {
31
31
try {
32
32
const { data } = action
33
33
const { month, year } = data
34
+ const images = get ( data , 'images' , [ ] )
34
35
const vehicle = yield call ( vehiclesService . create , {
35
36
...data ,
36
37
regDate : new Date ( toNumber ( year ) , toNumber ( month ) ) ,
@@ -39,6 +40,11 @@ function* handleCreateListing(action) {
39
40
} ,
40
41
modelId : get ( data , 'model' ) ,
41
42
makeId : get ( data , 'make' ) ,
43
+ images : images . map ( ( image , index ) => ( {
44
+ imageId : image . _id ,
45
+ order : index ,
46
+ ...image ,
47
+ } ) ) ,
42
48
} )
43
49
const result = yield call ( listingsService . create , {
44
50
...data ,
@@ -54,7 +60,7 @@ function* handleCreateListing(action) {
54
60
} )
55
61
setTimeout ( ( ) => {
56
62
Router . push ( '/' )
57
- } , 300 )
63
+ } , 900 )
58
64
} catch ( error ) {
59
65
console . error ( error )
60
66
yield put ( { type : Types . CREATE_LISTING_FAILURE } )
You can’t perform that action at this time.
0 commit comments