feat: with updated things

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2023-07-07 21:23:52 +02:00
parent 36e2766bb9
commit 8ee2ca5c14
21 changed files with 386 additions and 24 deletions

View File

@@ -1,6 +1,5 @@
use graphql_client::{GraphQLQuery, Response};
use leptos::*;
use leptos_router::*;
use crate::features::navbar_projects::gen::queries::get_projects_list_view::{
ResponseData, Variables,
@@ -18,7 +17,10 @@ pub async fn get_projects_list() -> anyhow::Result<Vec<GetProjectsListViewGetPro
.send()
.await?;
let response_body: Response<ResponseData> = res.json().await?;
Ok(response_body.data.unwrap().get_projects)
Ok(response_body
.data
.ok_or(anyhow::anyhow!("failed to get projects list"))?
.get_projects)
}
#[component]
@@ -38,7 +40,10 @@ pub fn NavbarProjectsView(
.map(|project| {
view! { cx,
<a href=format!("/dash/project/{}", & project.id) class="project-item">
<div class="project-item-name hover:dark:bg-blue-700 rounded-md p-0.5 px-2">
<div class="project-item-name hover:dark:bg-blue-700 rounded-md p-0.5 px-2">
{&project.name}
</div>
</a>