feat: with items

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2023-06-04 11:02:51 +02:00
parent 12c7c8f6ee
commit 534b2e4a23
25 changed files with 517 additions and 111 deletions

View File

@@ -1,6 +1,6 @@
use async_graphql::{Context, Object};
use como_domain::projects::ProjectDto;
use como_domain::users::User;
use como_infrastructure::register::ServiceRegister;
use uuid::Uuid;
@@ -22,16 +22,16 @@ impl Project {
}
async fn items(&self, ctx: &Context<'_>) -> anyhow::Result<Vec<Item>> {
let user = ctx.data_unchecked::<User>();
let context = ctx.data_unchecked::<como_domain::Context>();
let items = ctx
.data_unchecked::<ServiceRegister>()
.item_service
.get_items(
context,
como_domain::item::queries::GetItemsQuery {
project_id: self.id,
},
user,
)
.await?
.iter()