feat: update scripts to use new cuddle
Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use crate::common::*;
|
||||
use crate::items::{CreatedItem, Item};
|
||||
use crate::projects::Project;
|
||||
use async_graphql::{Context, EmptySubscription, Object, Schema};
|
||||
use como_domain::item::queries::{GetItemQuery, GetItemsQuery};
|
||||
use como_domain::item::requests::{CreateItemDto, UpdateItemDto};
|
||||
@@ -77,15 +78,17 @@ impl QueryRoot {
|
||||
&self,
|
||||
ctx: &Context<'_>,
|
||||
query: GetProjectQuery,
|
||||
) -> anyhow::Result<ProjectDto> {
|
||||
) -> anyhow::Result<Project> {
|
||||
project_service(ctx)
|
||||
.get_project(get_domain_context(ctx), query)
|
||||
.await
|
||||
.map(|p| p.into())
|
||||
}
|
||||
|
||||
async fn get_projects(&self, ctx: &Context<'_>) -> anyhow::Result<Vec<ProjectDto>> {
|
||||
async fn get_projects(&self, ctx: &Context<'_>) -> anyhow::Result<Vec<Project>> {
|
||||
project_service(ctx)
|
||||
.get_projects(get_domain_context(ctx))
|
||||
.await
|
||||
.map(|p| p.into_iter().map(|p| p.into()).collect())
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user