Last active
August 24, 2018 21:01
-
-
Save bobsilverberg/b84e344f670732dbbd6612d7017b58bc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case CLEAR_ADDON_REVIEWS_FOR_REVIEWID: { | |
const { | |
payload: { reviewId }, | |
} = action; | |
const newState = { ...state }; | |
const reviewData = state.byId[reviewId]; | |
if (reviewData) { | |
const { addonId, addonSlug, userId } = reviewData; | |
delete newState.byId[reviewId]; | |
return { | |
...newState, | |
byAddon: { | |
...newState.byAddon, | |
[addonSlug]: undefined, | |
}, | |
byUserId: { | |
...newState.byUserId, | |
[userId]: undefined, | |
}, | |
groupedRatings: { | |
...newState.groupedRatings, | |
[addonId]: undefined, | |
}, | |
}; | |
} | |
return newState; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment