Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Clients/Angular/finki-chattery/src/app/core/state/question-state/question.reducers.ts

    r6165fd0 r9df3069  
    162162      };
    163163    }
    164     case QuestionActionTypes.DeleteAnswerSuccess: {
    165       if (state.question) {
    166         return {
    167           ...state,
    168           question: {
    169             ...state.question,
    170             answers: state.question.answers.filter((x) => x.uid !== action.payload)
    171           }
    172         };
    173       }
    174 
    175       return {
    176         ...state
    177       };
    178     }
    179     case QuestionActionTypes.DeleteAnswerResponseSuccess: {
    180       if (state.question) {
    181         return {
    182           ...state,
    183           question: {
    184             ...state.question,
    185             answers: state.question.answers.map((x) => {
    186               if (x.uid === action.answerUid) {
    187                 return {
    188                   ...x,
    189                   answerResponses: x.answerResponses.filter((y) => y.uid !== action.payload)
    190                 };
    191               }
    192 
    193               return x;
    194             })
    195           }
    196         };
    197       }
    198 
    199       return {
    200         ...state
    201       };
    202     }
    203164    case QuestionActionTypes.AnswerQuestionSuccess: {
    204165      if (state.question) {
Note: See TracChangeset for help on using the changeset viewer.