feat: Working on the propsal page:

- Integerated the view proposal detail db call
- Use real data instead of mock data
This commit is contained in:
Mahmoud-Emad
2025-05-21 12:21:38 +03:00
parent 4a2f1c7282
commit 9c71c63ec5
4 changed files with 142 additions and 124 deletions

View File

@@ -1,4 +1,4 @@
use crate::db::proposals;
use crate::db::proposals::{self, get_proposal_by_id};
use crate::models::governance::{Vote, VoteType, VotingResults};
use crate::utils::render_template;
use actix_session::Session;
@@ -126,8 +126,8 @@ impl GovernanceController {
}
// Get mock proposal detail
let proposal = Self::get_mock_proposal_by_id(&proposal_id);
if let Some(proposal) = proposal {
let proposal = get_proposal_by_id(proposal_id.parse().unwrap());
if let Ok(Some(proposal)) = proposal {
ctx.insert("proposal", &proposal);
// Get mock votes for this proposal