Added account history in the ui.
This commit is contained in:
1 parent
f4593df95b
commit
18e7b0df1c
5 files changed
+78
-10
No files matched your search
@@ -22,9 +22,10 @@ pub struct AccountDTO {
|
||||
pub label: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Debug)]
|
||||
#[derive(Serialize, Debug)]
|
||||
pub struct AccountHistoryDTO {
|
||||
|
||||
amounts: Vec<i64>,
|
||||
timestamps: Vec<i64>,
|
||||
}
|
||||
|
||||
impl AccountDTO {
|
||||
@@ -72,9 +73,14 @@ impl AccountService<'_> {
|
||||
Ok(AccountDTO::from_entity(ret))
|
||||
}
|
||||
|
||||
pub fn get_account_history_by_id(&self, account_id: &AccountId, user_id: &UserId) -> CustomResult<()> {
|
||||
let ret = account_history::get_account_history(self.conn, account_id)?;
|
||||
pub fn get_account_history_by_id(&self, account_id: &AccountId, user_id: &UserId) -> CustomResult<AccountHistoryDTO> {
|
||||
let ac = account_history::get_account_history(self.conn, account_id)?;
|
||||
// ret.account()
|
||||
let ret = AccountHistoryDTO{
|
||||
amounts: ac.amount().clone(),
|
||||
timestamps: ac.timestamps().clone(),
|
||||
};
|
||||
|
||||
Ok(())
|
||||
Ok(ret)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user