G
Size: a a a
G
ЮЧ
G
G
G
Ю
export const getList = (ids = null) => async dispatch => {
const url = ids !== null ? `${BASE_URL}/api/goods/?dealers=${ids}` : `${BASE_URL}/api/goods/`;
try {
const res = await axios({
baseURL: url,
method: "GET"
})
dispatch({
type: LOAD_PRODUCT_LIST,
payload: res.data,
})
} catch (err) {
dispatch({
type: LOAD_PRODUCT_LIST,
payload: []
})
}
}
ЮЧ
Ю
useEffect(() => {
dispatch(getList(dealers))
}, [dealers])
G
G
ЮЧ
ЮЧ
Ю
G
export const getList = (ids = null) => async dispatch => {
const url = ids !== null ? `${BASE_URL}/api/goods/?dealers=${ids}` : `${BASE_URL}/api/goods/`;
try {
const res = await axios({
baseURL: url,
method: "GET"
})
dispatch({
type: LOAD_PRODUCT_LIST,
payload: res.data,
})
} catch (err) {
dispatch({
type: LOAD_PRODUCT_LIST,
payload: []
})
}
}
VC
PE
PE
VC
VC