feat: with updated deps

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2023-06-04 14:42:38 +02:00
parent 534b2e4a23
commit 2604c5e301
21 changed files with 509 additions and 396 deletions

View File

@@ -1,9 +1,9 @@
use crate::common::*;
use async_graphql::{Context, Object};
use como_domain::{
item::{queries::GetItemQuery, ItemDto, ItemState},
projects::queries::GetProjectQuery,
};
use como_infrastructure::register::ServiceRegister;
use uuid::Uuid;
use crate::projects::Project;
@@ -15,12 +15,8 @@ pub struct CreatedItem {
#[Object]
impl CreatedItem {
pub async fn item(&self, ctx: &Context<'_>) -> anyhow::Result<Item> {
let context = ctx.data_unchecked::<como_domain::Context>();
let item = ctx
.data_unchecked::<ServiceRegister>()
.item_service
.get_item(context, GetItemQuery { item_id: self.id })
let item = item_service(ctx)
.get_item(get_domain_context(ctx), GetItemQuery { item_id: self.id })
.await?;
Ok(item.into())
@@ -54,12 +50,9 @@ impl Item {
}
pub async fn project(&self, ctx: &Context<'_>) -> anyhow::Result<Project> {
let context = ctx.data_unchecked::<como_domain::Context>();
let project = ctx
.data_unchecked::<ServiceRegister>()
.project_service
let project = project_service(ctx)
.get_project(
context,
get_domain_context(ctx),
GetProjectQuery {
project_id: self.project_id,
},