Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update redux reducer state

I want to update my content on same page, but after server update it shows old data

Name : Arnold Schwarzenegger

after i update my data Arnold Schwarzenegger to Schwarzenegger using redux-from, Its changed on server but it shows Arnold Schwarzenegger on page

After success, i want to replace state with new data, in my case i am using

EDIT


    case 'EDIT_REQUEST':
    return {} // checking the id is same or not using action ID

    case 'EDIT_SUCCESS': // after server update
    return {} // i want to change data using action id, 
unfortunately  action is not available her

    case 'EDIT_FAILURE':
    return {}
like image 889
Harry Edward Avatar asked Mar 19 '26 12:03

Harry Edward


1 Answers

after i update my data Arnold Schwarzenegger to Schwarzenegger using redux-from, Its changed on server but it shows Arnold Schwarzenegger on page

it's means your server return with old data, please check your update or findOneAndUpdate have { new: true }

like image 162
Shanu T Thankachan Avatar answered Mar 21 '26 07:03

Shanu T Thankachan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!