change queries

This commit is contained in:
2026-05-25 19:26:24 +02:00
parent e6a011f159
commit e0f78a12e1
12 changed files with 1375 additions and 1160 deletions

View File

@@ -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?)

View File

@@ -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