260727_01_ENH: 전화 걸기 ws 틀어막기, 선택 항목만인경우 선택된 것이 없으면 오류

This commit is contained in:
2026-07-27 16:37:26 +09:00
parent 58e9d0702e
commit 157ba6155d
9 changed files with 393 additions and 158 deletions

View File

@@ -12,8 +12,13 @@ export type ApplyFilterOptionValue = ListFilterTarget
* alert 후 진행을 막아야 하는 호출부에서 공통으로 사용한다.
*/
export const validateApplyFilterTarget = (value: ApplyFilterOptionValue, filterSummary?: string[]): boolean => {
if (value === 'filtered' && (filterSummary?.length ?? 0) === 0) {
alert('적용된 필터가 없습니다. 필터를 적용해 주세요.')
if (["selected", "filtered"].includes(value) && (filterSummary?.length ?? 0) === 0) {
const alertText: string =
value === "selected" ?
"선택된 항목이 없습니다. 항목을 선택해 주세요"
: "적용된 필터가 없습니다. 필터를 적용해 주세요."
alert(alertText)
return false
}
return true