mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 00:18:12 +00:00
settings_profile_fields: Iterate over field_data with Object.entries.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
committed by
Tim Abbott
parent
dd10108c24
commit
f912572887
@@ -215,13 +215,13 @@ function get_profile_field(id) {
|
|||||||
|
|
||||||
exports.parse_field_choices_from_field_data = function (field_data) {
|
exports.parse_field_choices_from_field_data = function (field_data) {
|
||||||
const choices = [];
|
const choices = [];
|
||||||
_.each(field_data, function (choice, value) {
|
for (const [value, choice] of Object.entries(field_data)) {
|
||||||
choices.push({
|
choices.push({
|
||||||
value: value,
|
value: value,
|
||||||
text: choice.text,
|
text: choice.text,
|
||||||
order: choice.order,
|
order: choice.order,
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
|
|
||||||
return choices;
|
return choices;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user