people: Fix get_custom_fields_by_type type.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2024-05-29 22:44:37 -07:00 committed by Anders Kaseorg
parent a01d68e838
commit c20af83770
1 changed files with 2 additions and 2 deletions

View File

@ -1722,13 +1722,13 @@ export function get_custom_profile_data(
export function get_custom_fields_by_type(
user_id: number,
field_type: number,
): ProfileDatum[] | null {
): (ProfileDatum | undefined)[] | null {
const person = get_by_user_id(user_id);
const profile_data = person.profile_data;
if (profile_data === undefined) {
return null;
}
const filteredProfileData: ProfileDatum[] = [];
const filteredProfileData: (ProfileDatum | undefined)[] = [];
for (const field of realm.custom_profile_fields) {
if (field.type === field_type) {
filteredProfileData.push(profile_data[field.id]);