mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 08:26:11 +00:00
people: Fix get_custom_fields_by_type type.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Anders Kaseorg
parent
a01d68e838
commit
c20af83770
@@ -1722,13 +1722,13 @@ export function get_custom_profile_data(
|
|||||||
export function get_custom_fields_by_type(
|
export function get_custom_fields_by_type(
|
||||||
user_id: number,
|
user_id: number,
|
||||||
field_type: number,
|
field_type: number,
|
||||||
): ProfileDatum[] | null {
|
): (ProfileDatum | undefined)[] | null {
|
||||||
const person = get_by_user_id(user_id);
|
const person = get_by_user_id(user_id);
|
||||||
const profile_data = person.profile_data;
|
const profile_data = person.profile_data;
|
||||||
if (profile_data === undefined) {
|
if (profile_data === undefined) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
const filteredProfileData: ProfileDatum[] = [];
|
const filteredProfileData: (ProfileDatum | undefined)[] = [];
|
||||||
for (const field of realm.custom_profile_fields) {
|
for (const field of realm.custom_profile_fields) {
|
||||||
if (field.type === field_type) {
|
if (field.type === field_type) {
|
||||||
filteredProfileData.push(profile_data[field.id]);
|
filteredProfileData.push(profile_data[field.id]);
|
||||||
|
|||||||
Reference in New Issue
Block a user