This commit is contained in:
parent
f8b9c32e0c
commit
dc82d7baf8
1 changed files with 24 additions and 21 deletions
|
@ -17,9 +17,9 @@ pub async fn page(config: web::Data<Config>) -> impl Responder {
|
|||
#[derive(Content)]
|
||||
struct PortfolioTemplate {
|
||||
error: bool,
|
||||
projects: Vec<Project>,
|
||||
waiting: Vec<Project>,
|
||||
closed: Vec<Project>,
|
||||
projects: Option<Vec<Project>>,
|
||||
waiting: Option<Vec<Project>>,
|
||||
closed: Option<Vec<Project>>,
|
||||
}
|
||||
|
||||
#[derive(Content, Clone)]
|
||||
|
@ -94,21 +94,24 @@ pub async fn get_page(config: Config) -> std::string::String {
|
|||
|
||||
PortfolioTemplate {
|
||||
error: false,
|
||||
projects: data
|
||||
.iter()
|
||||
projects: Some(
|
||||
data.iter()
|
||||
.cloned()
|
||||
.filter(|p| !p.pulls_merged.is_empty())
|
||||
.collect(),
|
||||
waiting: data
|
||||
.iter()
|
||||
),
|
||||
waiting: Some(
|
||||
data.iter()
|
||||
.cloned()
|
||||
.filter(|p| !p.pulls_open.is_empty())
|
||||
.collect(),
|
||||
closed: data
|
||||
.iter()
|
||||
),
|
||||
closed: Some(
|
||||
data.iter()
|
||||
.cloned()
|
||||
.filter(|p| !p.pulls_closed.is_empty())
|
||||
.collect(),
|
||||
),
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
|
@ -116,9 +119,9 @@ pub async fn get_page(config: Config) -> std::string::String {
|
|||
|
||||
PortfolioTemplate {
|
||||
error: true,
|
||||
projects: Vec::new(),
|
||||
waiting: Vec::new(),
|
||||
closed: Vec::new(),
|
||||
projects: None,
|
||||
waiting: None,
|
||||
closed: None,
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue