bugfix rahdar code and car code

This commit is contained in:
2025-01-05 07:25:53 +00:00
committed by AmirHossein Mahmoodi
parent fa4c3e1459
commit c28824a58e
2 changed files with 4 additions and 3 deletions

View File

@@ -21,8 +21,7 @@ const CarCode = ({ carCode, setCarCode, inputValueDefault = "", error, multiple
requestOptions: { signal: controller.signal },
})
.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());
setOptions(uniqueArray || []);
})