Skip to content
Snippets Groups Projects

add feature: amendement field for searching a single amendement based on its uid

Merged Emmanuel Raviart requested to merge feature/amendement into master
1 file
+ 20
1
Compare changes
  • Side-by-side
  • Inline
+ 20
1
@@ -198,7 +198,26 @@ graphql_object!(Query: Context |&self| {
Ok(reunions)
}
field amendements(&executor, since: Option<String>, until: Option<String>) -> FieldResult<Vec<&Amendement>> {
field amendement(&executor, id: String as "Identifiant (uid) de l'amendement recherché") -> FieldResult<Option<&Amendement>> as "Rechercher un amendement par son identifiant" {
let mut amendement: Option<&Amendement> = None;
for wrapper in &executor.context().amendements_wrappers{
for texteleg in &wrapper.textes_et_amendements{
for txtleg in &texteleg.texteleg{
for amds in &txtleg.amendements{
for amd in &amds.amendements{
if &amd.uid == &id {
amendement = Some(&amd)
}
}
}
}
}
}
Ok(amendement)
}
field amendements(&executor, since: Option<String> as "Date de départ de la recherche des amendements, au format YYYY-MM-DD", until: Option<String> as "Date limite de la recherche des amendements, au format YYYY-MM-DD") -> FieldResult<Vec<&Amendement>> as "Obtenir la liste des amendements, optionnellement en fournissant une date de départ et une date de fin pour la recherche."{
let mut amendements: Vec<&Amendement> = Vec::new();
let parse_from_str = NaiveDate::parse_from_str;
Loading