refactor: Rename proposals
module to governance
The `proposals` module has been renamed to `governance` to better reflect its purpose and content. This improves code clarity and consistency. - Renamed the `proposals` module to `governance` throughout the project to reflect the broader scope of governance features. - Updated all related imports and function calls to use the new module name.
This commit is contained in:
parent
7b15606da5
commit
2827cfebc9
@ -1,4 +1,4 @@
|
||||
use crate::db::proposals::{
|
||||
use crate::db::governance::{
|
||||
self, create_activity, get_all_activities, get_proposal_by_id, get_proposals,
|
||||
get_recent_activities,
|
||||
};
|
||||
@ -100,7 +100,7 @@ impl GovernanceController {
|
||||
ctx.insert("user", &user);
|
||||
|
||||
// Get proposals from the database
|
||||
let proposals = match crate::db::proposals::get_proposals() {
|
||||
let proposals = match crate::db::governance::get_proposals() {
|
||||
Ok(props) => {
|
||||
// println!(
|
||||
// "📋 Proposals list page: Successfully loaded {} proposals from database",
|
||||
@ -375,7 +375,7 @@ impl GovernanceController {
|
||||
} else {
|
||||
ProposalStatus::Active
|
||||
};
|
||||
match proposals::create_new_proposal(
|
||||
match governance::create_new_proposal(
|
||||
&user_id,
|
||||
&user_name,
|
||||
proposal_title,
|
||||
@ -409,7 +409,7 @@ impl GovernanceController {
|
||||
// For now, we'll just redirect to the proposals page with a success message
|
||||
|
||||
// Get proposals from the database
|
||||
let proposals = match crate::db::proposals::get_proposals() {
|
||||
let proposals = match crate::db::governance::get_proposals() {
|
||||
Ok(props) => {
|
||||
println!(
|
||||
"✅ Successfully loaded {} proposals from database",
|
||||
@ -485,7 +485,7 @@ impl GovernanceController {
|
||||
};
|
||||
|
||||
// Submit the vote
|
||||
match crate::db::proposals::submit_vote_on_proposal(
|
||||
match crate::db::governance::submit_vote_on_proposal(
|
||||
proposal_id_u32,
|
||||
user_id,
|
||||
&form.vote_type,
|
||||
@ -546,7 +546,7 @@ impl GovernanceController {
|
||||
let user_id = user.get("id").and_then(|v| v.as_i64()).unwrap_or(1) as i32;
|
||||
|
||||
// Get all proposals from the database
|
||||
let proposals = match crate::db::proposals::get_proposals() {
|
||||
let proposals = match crate::db::governance::get_proposals() {
|
||||
Ok(props) => props,
|
||||
Err(e) => {
|
||||
ctx.insert("error", &format!("Failed to load proposals: {}", e));
|
||||
|
@ -1,2 +1,2 @@
|
||||
pub mod db;
|
||||
pub mod proposals;
|
||||
pub mod governance;
|
||||
|
Loading…
Reference in New Issue
Block a user