Add optional word
This commit is contained in:
parent
423dcb6914
commit
b12fcef1b3
1 changed files with 14 additions and 0 deletions
|
@ -149,6 +149,20 @@ impl Config {
|
|||
config.state_config.strings.message_from =
|
||||
config.state_config.strings.message_from.trim().to_string() + " ";
|
||||
|
||||
// Add the optional word to fields without a required_feedback.
|
||||
config
|
||||
.state_config
|
||||
.custom_fields
|
||||
.iter_mut()
|
||||
.filter(|field| field.required_feedback.is_none())
|
||||
.for_each(|field| {
|
||||
field.label = format!(
|
||||
"{} ({})",
|
||||
field.label.trim(),
|
||||
config.state_config.strings.optional
|
||||
);
|
||||
});
|
||||
|
||||
Ok(config)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue