Commit a9bfd3ac authored by Emmanuel Raviart's avatar Emmanuel Raviart

Merge branch 'feature/amendement' into 'master'

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

See merge request !5
parents 1583e113 c09d920a
......@@ -198,7 +198,26 @@ graphql_object!(Query: Context |&self| {
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)
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;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment