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)]
|
#[derive(Content)]
|
||||||
struct PortfolioTemplate {
|
struct PortfolioTemplate {
|
||||||
error: bool,
|
error: bool,
|
||||||
projects: Vec<Project>,
|
projects: Option<Vec<Project>>,
|
||||||
waiting: Vec<Project>,
|
waiting: Option<Vec<Project>>,
|
||||||
closed: Vec<Project>,
|
closed: Option<Vec<Project>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Content, Clone)]
|
#[derive(Content, Clone)]
|
||||||
|
@ -94,21 +94,24 @@ pub async fn get_page(config: Config) -> std::string::String {
|
||||||
|
|
||||||
PortfolioTemplate {
|
PortfolioTemplate {
|
||||||
error: false,
|
error: false,
|
||||||
projects: data
|
projects: Some(
|
||||||
.iter()
|
data.iter()
|
||||||
.cloned()
|
.cloned()
|
||||||
.filter(|p| !p.pulls_merged.is_empty())
|
.filter(|p| !p.pulls_merged.is_empty())
|
||||||
.collect(),
|
.collect(),
|
||||||
waiting: data
|
),
|
||||||
.iter()
|
waiting: Some(
|
||||||
|
data.iter()
|
||||||
.cloned()
|
.cloned()
|
||||||
.filter(|p| !p.pulls_open.is_empty())
|
.filter(|p| !p.pulls_open.is_empty())
|
||||||
.collect(),
|
.collect(),
|
||||||
closed: data
|
),
|
||||||
.iter()
|
closed: Some(
|
||||||
|
data.iter()
|
||||||
.cloned()
|
.cloned()
|
||||||
.filter(|p| !p.pulls_closed.is_empty())
|
.filter(|p| !p.pulls_closed.is_empty())
|
||||||
.collect(),
|
.collect(),
|
||||||
|
),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
|
@ -116,9 +119,9 @@ pub async fn get_page(config: Config) -> std::string::String {
|
||||||
|
|
||||||
PortfolioTemplate {
|
PortfolioTemplate {
|
||||||
error: true,
|
error: true,
|
||||||
projects: Vec::new(),
|
projects: None,
|
||||||
waiting: Vec::new(),
|
waiting: None,
|
||||||
closed: Vec::new(),
|
closed: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue