not sorted basket

This commit is contained in:
wrzesinski-hubert
2020-11-20 21:20:32 +01:00
parent 47bfd9572c
commit 9a88736584
3 changed files with 15 additions and 3 deletions

View File

@ -50,7 +50,18 @@ export const Rightbar = () => {
const getBasketGroups = () => {
const names = basket.map(({ name }) => name);
return courses.filter(({ name }) => names.includes(name));
const list = []
for (const basketName of names){
const course = courses.find(({name})=>basketName===name)!
list.push(course);
}
console.log("asdasdsa1", list);
console.log("asdasdsa2", courses.filter(({ name }) => names.includes(name)));
return list;
};
const filteredCourses = getBasketGroups();