I am trying to retrieve car manufacturer ID's using AXIOS within VueJs front-end and Spring back-end.
In the code provided below I have achieved that, however some of the ID's repeat(this is meant to happen), the question is how is it possible to filter out the duplicate ID's?
My getMethod
below.
getMethod () {
AXIOS.get(`/url/`)
.then(response => {
if (response.status == 200) {
this.response = response.data
this.myTest = response.data.map(mesg => mesg.carManufacterId)
console.log(this.myTest)
}
},
(err) => {
if (err.response.status == 500) {
console.log('turned off')
}
else if (err.response.status == 404) {
console.log('Could not retrieve)
}
})
},