BUG #2 The heart-button crashes the forum
Summary
- Priority: P2
When user clicks the heart-icon of one of the articles the page crashes.
Steps to reproduce
Global feed of the main page -> clicking any of the heart-icon of the articles.
What is the current bug behavior?
"Unhandled Rejection (TypeError): action.payload.article is undefined)"
What is the expected correct behavior?
(What you should see instead)
Relevant logs and/or screenshots
./src/reducers/articleList.js/__webpack_exports__.a/<.articles<
src/app/src/reducers/articleList.js:22
19 | return {
20 | ...state,
21 | articles: state.articles.map(article => {
> 22 | if (article.slug === action.payload.article.slug) {
23 | return {
24 | ...article,
25 | favorited: action.payload.article.favorited,
./src/reducers/articleList.js/__webpack_exports__.a
src/app/src/reducers/articleList.js:21
18 | case ARTICLE_UNFAVORITED:
19 | return {
20 | ...state,
> 21 | articles: state.articles.map(article => {
22 | if (article.slug === action.payload.article.slug) {
23 | return {
24 | ...article,
Possible fixes
(If you can, link to the line of code that might be responsible for the problem)
Information about fixing the problem (in finnish): https://gitlab.labranet.jamk.fi/devops2020/lokaalit-palvelut#backend-korjauksia
Edited by Ghost User