260624_01_ENH: 사용자 수정 관련 수정

This commit is contained in:
2026-06-24 09:40:24 +09:00
parent c87557947f
commit 3d4fa65b0e
4 changed files with 33 additions and 23 deletions

View File

@@ -35,14 +35,12 @@ export const getCodeLabel = (
export const getDetailValue = (
detail: Record<string, string> | undefined,
keys: string[],
key: string,
fallback = ""
) => {
if (!detail) return fallback;
for (const key of keys) {
const value = detail[key];
if (value !== undefined && value !== "") return value;
}
const value = detail[key];
if (value !== undefined && value !== "") return value;
return fallback;
};
@@ -92,9 +90,9 @@ export const filterUser = (
}
) => {
const detail = user.userDetail ?? {};
const area = getDetailValue(detail, ["area", "userArea", "region"]);
const gender = getDetailValue(detail, ["gender", "userGender"]);
const genre = getDetailValue(detail, ["genre", "performanceGenre", "reviewGenre"]);
const area = getDetailValue(detail, "userArea");
const gender = getDetailValue(detail, "userGender");
const genre = getDetailValue(detail, "userGenre");
const keyword = filters.keyword?.trim() ?? "";
const matches = (filter: string | string[] | undefined, value: string) => {
if (!filter || filter.length === 0) return true;
@@ -112,8 +110,8 @@ export const filterUser = (
includesText(user.userTeam, keyword) ||
includesText(user.userCmpn, keyword) ||
includesText(user.memo, keyword) ||
includesText(getDetailValue(detail, ["tel", "phone", "userTel"]), keyword) ||
includesText(getDetailValue(detail, ["email", "userEmail"]), keyword)
includesText(getDetailValue(detail, "userTel"), keyword) ||
includesText(getDetailValue(detail, "userEmail"), keyword)
)
);
};