buckyroberts / Vataxia-Frontend

Open source social network written in React and Redux
http://vataxia.io/
252 stars 77 forks source link

Wallet balance #52

Open buckyroberts opened 7 years ago

buckyroberts commented 7 years ago

Bug getting wallet balance since primary key was changed

PaulsBecks commented 6 years ago

Yes, I think this bug is due to the fact that wallet.id != user.id

This would be a thing to change in the back-end, I guess. To get around this problem one could ad the following in Vataxia-Frontend/src/actions/credits/wallet/get.js

after

  const response = await axios.get(`${settings.API_ROOT}/wallets/${userId}`, tokenHeader());

ad

  response.data['_id'] = response.data['id']
  response.data['id'] = response.data['user']['id']

Its now already a year ago, but might be still useful to someone.