settings_profile_fields: Iterate over field_data with Object.entries.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
Anders Kaseorg
2020-02-05 21:34:47 -08:00
committed by Tim Abbott
parent dd10108c24
commit f912572887

View File

@@ -215,13 +215,13 @@ function get_profile_field(id) {
exports.parse_field_choices_from_field_data = function (field_data) {
const choices = [];
_.each(field_data, function (choice, value) {
for (const [value, choice] of Object.entries(field_data)) {
choices.push({
value: value,
text: choice.text,
order: choice.order,
});
});
}
return choices;
};