Skip to content

Commit

Permalink
working add and delete buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
brianjshan committed Oct 7, 2020
1 parent 816d9e6 commit 6708125
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client/components/ActivitiesView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ const ActivitiesView = (props) => {
const deleteFav = (businessId) => {
const newFav = [];
for (let i = 0; i < favoriteActivities.length; i++) {
if (favoriteActivities[i].id !== businessId) {
newFav.push(favoriteActivities[i]);
} else {
if (favoriteActivities[i].id === businessId) {
favoriteActivities.splice(i, 1);
} else {
newFav.push(favoriteActivities[i]);
}
}
setFavoriteActivities(createActivities(newFav));
Expand Down

0 comments on commit 6708125

Please sign in to comment.