From 8d67300d5f0583731630c9f84c3f8983982b91d3 Mon Sep 17 00:00:00 2001 From: EliasSchriefer Date: Sun, 17 Oct 2021 16:58:04 +0000 Subject: [PATCH] Change return type of createUser to ID --- src/graphql.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/graphql.rs b/src/graphql.rs index b462261..0fb2516 100644 --- a/src/graphql.rs +++ b/src/graphql.rs @@ -397,7 +397,7 @@ pub struct Mutation; #[graphql_object(context = Context)] impl Mutation { - async fn createUser(context: &Context, new_user: NewUser) -> FieldResult { + async fn createUser(context: &Context, new_user: NewUser) -> FieldResult { let user: User = new_user.into(); if sqlx::query( @@ -475,7 +475,7 @@ impl Mutation { external_servers_privacy_preferences.info_server_limit.iter().map(|u| u.to_string()).collect::>().join(","), ).as_str()).execute(&context.db).await?; - Ok(format!("User @{} created", user.user_name)) + Ok(ID::new(id_to_uuid(&user.id)?.to_simple().to_string())) } }