Skip to content

Commit 81ab97c

Browse files
committed
response adaptation of fe.
1 parent 2344b8b commit 81ab97c

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

BankApplicationFrontend/src/components/MoneyBar/MoneyBar.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ class MoneyBar extends React.Component {
5353
const request = new Request().getRequestInstance(null, this.props.token);
5454
request.post(URL_RETRIEVEWEALTH, { username: this.props.loggedInUsername })
5555
.then((response) => {
56-
Object.keys(response.data.wealthMap).map((key) => {
57-
if (response.data.wealthMap[key] == 0) delete response.data.wealthMap[key];
56+
Object.keys(response.data.wealth.wealthMap).map((key) => {
57+
if (response.data.wealth.wealthMap[key] == 0) delete response.data.wealth.wealthMap[key];
5858
});
5959
this.props.currenciesUptodate();
60-
this.setState({ ownedCurrencies: response.data.wealthMap });
60+
this.setState({ ownedCurrencies: response.data.wealth.wealthMap });
6161
}).catch((error) => {
6262
console.log(error.response);
6363
var errorMessage = 'Network error.';

BankApplicationFrontend/src/components/pages/CurrencyPage/CurrencyList/Currency/BuySellModal/BuySellModal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class BuySellModal extends React.Component {
4646
currency: this.props.currency,
4747
amount: this.state.inputAmount
4848
}).then((response) => {
49-
this.props.callback(true, (this.props.isBuying ? "Bought " : "Sold ") + response.data.amount + " " + response.data.currency + ".", 2);
49+
this.props.callback(true, (this.props.isBuying ? "Bought " : "Sold ") + response.data.transaction.amount + " " + response.data.transaction.currency + ".", 2);
5050
}).catch((error) => {
5151
console.log(error.response != null ? error.response : error);
5252
var errorMessage = 'Network Error';

BankApplicationFrontend/src/components/pages/HistoryPage/HistoryPage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class HistoryPage extends React.Component {
3636
username: this.props.loggedInUsername
3737
}).then((response) => {
3838
console.log(response);
39-
this.setState({ histories: response.data });
39+
this.setState({ histories: response.data.transactionList });
4040
}).catch((error) => {
4141
console.log(error.response);
4242
var errorMessage = 'Network error';

BankApplicationFrontend/src/components/pages/TransferPage/TransferPage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class TransferPage extends React.Component {
6565
amount: this.state.amount
6666
}).then((response) => {
6767
console.log(response);
68-
this.props.showPopup(2, 'Successfully transfered ' + response.data.amount + " " + response.data.currency + " to " + this.state.tcno + ".");
68+
this.props.showPopup(2, 'Successfully transfered ' + response.data.transfer.amount + " " + response.data.transfer.currency + " to " + this.state.tcno + ".");
6969
this.props.currenciesNeedUpdate();
7070
}).catch((error) => {
7171
console.log(error.response != null ? error.response : error);

BankApplicationFrontend/src/components/pages/UsersPage/UsersPage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class UsersPage extends React.Component {
2727
request.get(URL_RETRIEVEALLUSERS)
2828
.then((response) => {
2929
console.log(response);
30-
this.setState({ users: response.data });
30+
this.setState({ users: response.data.userList });
3131
}).catch((error) => {
3232
console.log(error.response);
3333
var errorMessage = 'Network error.';

0 commit comments

Comments
 (0)