I wanted to remove data from my array of objects, There are a lots of duplicate values in my data.
Array of Objects:
rawData = [
0: {
style_no: "BAG-011459",
Item_description: "Hoplite Top Load Bag Standard 21 x 36 Olive",
mon: "21310026-4",
type: "Bags",
oq: 51,
force_update: 62,
c_n: "WHITE DUCK",
pl_q: 51,
os: "Open",
},
1: {
style_no: "BAG-010865",
Item_description: "Hoplite Top Load Bag Large 25 x 42 Olive",
mon: "21310030-5",
type: "Bags",
oq: 102,
force_update: 63,
c_n: "WHITE DUCK",
pl_q: 102,
os: "Open",
},
2: {
style_no: "BAG-011932",
Item_description: "Hoplite Top Load Bag Large 25x42 Black",
mon: "21310035-8",
type: "Bags",
oq: 464,
force_update: 64,
c_n: "WHITE DUCK",
pl_q: 464,
os: "Open",
},
3:{
style_no: "BAG-011932",
Item_description: "Hoplite Top Load Bag Large 25x42 Black",
mon: "21310034-8",
type: "Bags",
oq: 464,
force_update: 65,
c_n: "WHITE DUCK",
pl_q: 464,
os: "Open",
},
4:{
style_no: "BAG-011931",
Item_description: "Hoplite Top Load Bag Standard 21x36 Black",
mon: "21310034-7",
type: "Bags",
oq: 160,
force_update: 66,
c_n: "WHITE DUCK",
pl_q: 160,
os: "Open",
},
5: {
style_no: "BAG-011931",
Item_description: "Hoplite Top Load Bag Standard 21x36 Black",
mon: "21310036-7",
type: "Bags",
oq: 150,
force_update: 67,
c_n: "WHITE DUCK",
pl_q: 150,
os: "Open",
},
6: {
style_no: "BAG-011931",
Item_description: "Hoplite Top Load Bag Standard 21x36 Black",
mon: "21310035-7",
type: "Bags",
oq: 160,
force_update: 68,
c_n: "WHITE DUCK",
pl_q: 160,
os: "Open",
},
7: {
style_no: "BAG-011460",
Item_description: "Hoplite Top Load Bag Extra Large 30 x 50 Olive",
mon: "21310034-6",
type: "Bags",
oq: 456,
force_update: 69,
c_n: "WHITE DUCK",
pl_q: 456,
os: "Open",
},
8: {
style_no: "BAG-011460",
Item_description: "Hoplite Top Load Bag Extra Large 30 x 50 Olive",
mon: "21310035-6",
type: "Bags",
oq: 456,
force_update: 70,
c_n: "WHITE DUCK",
pl_q: 456,
os: "Open",
},
]
Select Body:
{/* Customer */}
<FormControl sx={{ m: 0.5 }} variant="standard">
<InputLabel
style={{ fontSize: "15px" }}
id="demo-customized-select-label"
>
Customer
</InputLabel>
<Select
required
style={{
fontSize: "12px",
width: "125px",
}}
labelId="demo-customized-select-label"
id="demo-customized-select"
value={plandata.customer}
onChange={(e) => {
setPlanData((prev) => ({ ...prev, customer: e.target.value }));
}}
input={<BootstrapInput />}
>
{rawData
?.filter((data) => data.type.includes(plandata.division))
.map((value) => (
<MenuItem value={value.c_n.toString()}>
{value.c_n.toString()}
</MenuItem>
))}
</Select>
</FormControl>
The snippest of the select box is
Please if you know how to do it please answer this query, I am stuck on this project form last 2 months, wanted to do it asap, with your support thanks.
Note: I already go through the answers which was related to this question but not find my query.