change queries
This commit is contained in:
@@ -26,21 +26,21 @@ pub struct Benutzer {
|
||||
#[ComplexObject]
|
||||
impl Benutzer {
|
||||
/// Die Rollen des Benutzers
|
||||
pub async fn rollen<'ctx>(&self, ctx: &Context<'ctx>) -> FieldResult<Option<Vec<Rolle>>> {
|
||||
pub async fn rollen(&self, ctx: &Context<'_>) -> FieldResult<Option<Vec<Rolle>>> {
|
||||
let loader = ctx.data::<LoaderContext>()?;
|
||||
Ok(loader.rollen.load_one(self.id).await?)
|
||||
}
|
||||
|
||||
/// Die Gruppen des Benutzers
|
||||
pub async fn gruppen<'ctx>(&self, ctx: &Context<'ctx>) -> FieldResult<Option<Vec<Gruppe>>> {
|
||||
pub async fn gruppen(&self, ctx: &Context<'_>) -> FieldResult<Option<Vec<Gruppe>>> {
|
||||
let loader = ctx.data::<LoaderContext>()?;
|
||||
Ok(loader.gruppen.load_one(self.id).await?)
|
||||
}
|
||||
|
||||
/// Die Gruppen eines Benutzer kumulativ mit den Gruppen aus den Rollen
|
||||
pub async fn gruppen_kumulativ<'ctx>(
|
||||
pub async fn gruppen_kumulativ(
|
||||
&self,
|
||||
ctx: &Context<'ctx>,
|
||||
ctx: &Context<'_>,
|
||||
) -> FieldResult<Option<Vec<GruppeAnsicht>>> {
|
||||
let loader = ctx.data::<LoaderContext>()?;
|
||||
Ok(loader.benutzer_gruppen_kumulativ.load_one(self.id).await?)
|
||||
|
||||
@@ -6,7 +6,7 @@ use crate::domain::gruppe::model::Gruppe;
|
||||
use super::Repository;
|
||||
|
||||
impl Repository {
|
||||
pub async fn find_gruppen<'a>(&self, ctx: &'a Context<'_>) -> Result<Vec<Gruppe>, Error> {
|
||||
pub async fn find_gruppen(&self, _ctx: &Context<'_>) -> Result<Vec<Gruppe>, Error> {
|
||||
// let rows = sqlx::query!(
|
||||
// r#"
|
||||
// SELECT
|
||||
|
||||
@@ -5,7 +5,7 @@ use crate::scalar::{Id, Time};
|
||||
#[derive(sqlx::FromRow, SimpleObject, Clone, Debug)]
|
||||
#[graphql(complex)]
|
||||
pub struct Gruppe {
|
||||
/// Die UUIDl einer Gruppe
|
||||
/// Die UUID einer Gruppe
|
||||
pub id: Id,
|
||||
|
||||
/// Der Gruppenname
|
||||
|
||||
Reference in New Issue
Block a user