fn removeGroup(context: &Context, input: RemoveGroupInput) -> Result<bool, GraphQLError> {
        let RemoveGroupInput { group_id } = input;
        // Check input validity
        let group_id = match uuid::Uuid::parse_str(group_id.as_str()) {
            Err(e) => return Err(GraphQLError::InvalidId),
            Ok(u) => u,
        };
        // Delete the group
        repositories::GroupRepository::delete_one(&group_id, &context.db_pool)
            .map_err(GraphQLError::InternalServerError)
            .map(|_| true)
    }
// FIXME: Extract domain and repository logic to own module
/// Remove a group. Idempotent mutation.
/// This is a user context dependant mutation.
Extract domain and repository logic to own module
Remove a group. Idempotent mutation.
This is a user context dependant mutation.
Extract domain and repository logic to own module Remove a group . Idempotent mutation . This is a user context dependant mutation .
fn removeGroup(context: &Context, input: RemoveGroupInput) -> Result<bool, GraphQLError> {
        let RemoveGroupInput { group_id } = input;
        // Check input validity
        let group_id = match uuid::Uuid::parse_str(group_id.as_str()) {
            Err(e) => return Err(GraphQLError::InvalidId),
            Ok(u) => u,
        };
        // Delete the group
        repositories::GroupRepository::delete_one(&group_id, &context.db_pool)
            .map_err(GraphQLError::InternalServerError)
            .map(|_| true)
    }
fn removeGroup ( context : & Context , input : RemoveGroupInput ) -> Result < bool , GraphQLError > { let RemoveGroupInput { group_id } = input ; // Check input validity let group_id = match uuid :: Uuid :: parse_str ( group_id . as_str ( ) ) { Err ( e ) => return Err ( GraphQLError :: InvalidId ) , Ok ( u ) => u , } ; // Delete the group repositories :: GroupRepository :: delete_one ( & group_id , & context . db_pool ) . map_err ( GraphQLError :: InternalServerError ) . map ( | _ | true ) }
FIXME: Extract domain and repository logic to own module
Remove a group.
FIXME : Extract domain and repository logic to own module Remove a group .
context
&Context
input
RemoveGroupInput
context
&Context
input
RemoveGroupInput