Merge branch 'bugfix/multiple_single_select' into 'develop'
bugfix rahdar code and car code See merge request witel-front-end/rms!50
This commit is contained in:
@@ -21,8 +21,7 @@ const CarCode = ({ carCode, setCarCode, inputValueDefault = "", error, multiple
|
|||||||
requestOptions: { signal: controller.signal },
|
requestOptions: { signal: controller.signal },
|
||||||
})
|
})
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
const combinedArray = [...carCode, ...response.data.data];
|
const combinedArray = carCode ? [...carCode, ...response.data.data] : [...response.data.data];
|
||||||
|
|
||||||
const uniqueArray = Array.from(new Map(combinedArray.map((item) => [item.id, item])).values());
|
const uniqueArray = Array.from(new Map(combinedArray.map((item) => [item.id, item])).values());
|
||||||
setOptions(uniqueArray || []);
|
setOptions(uniqueArray || []);
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -22,7 +22,9 @@ const RahdarCode = ({ rahdarsCode, setRahdarsCode, error, multiple = true }) =>
|
|||||||
requestOptions: { signal: controller.signal },
|
requestOptions: { signal: controller.signal },
|
||||||
})
|
})
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
const combinedArray = [...rahdarsCode, ...response.data.data];
|
const combinedArray = rahdarsCode
|
||||||
|
? [...rahdarsCode, ...response.data.data]
|
||||||
|
: [...response.data.data];
|
||||||
const uniqueArray = Array.from(new Map(combinedArray.map((item) => [item.id, item])).values());
|
const uniqueArray = Array.from(new Map(combinedArray.map((item) => [item.id, item])).values());
|
||||||
setOptions(uniqueArray || []);
|
setOptions(uniqueArray || []);
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user