#42 formatting date

This commit is contained in:
Dominic Villemure
2024-05-18 12:06:17 -04:00
parent 768ab72713
commit ef0d1a041d
3 changed files with 24 additions and 5 deletions

View File

@@ -7,9 +7,18 @@ export default class MyUserModel
lastName = "";
userName = "";
totalBalance = "";
userTransactions = new UserTransactionsModel()
userTransactions = [];
static createFromApiResult(apiResult){
return Object.assign(new MyUserModel(), apiResult);
const userModel = Object.assign(new MyUserModel(), apiResult);
const notMapperTransaction = Object.freeze(userModel.userTransactions);
userModel.userTransactions = [];
for (const transaction of notMapperTransaction) {
userModel.userTransactions.push(UserTransactionsModel.createFromApiResult(transaction))
}
return userModel;
}
}