0👍
✅
You are checking if your Data.success
is true. If it comes as undefined in your data, it is going to go into the else block and call Error
.
Please check the data being sent
Source:stackexchange.com