From a483ffce445d555b9bf2ace112bdd7a0e0d845bf Mon Sep 17 00:00:00 2001 From: keyy1315 Date: Wed, 21 May 2025 18:21:22 +0900 Subject: [PATCH] fix: Detailed error resolution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 단열재 유무 기타 input 창 나오지 않는 오류 해결 - T01 임시저장 데이터 조회 가능하도록 로직 수정정 --- src/app/api/survey-sales/route.ts | 41 ++++++------------- .../survey-sale/detail/ButtonForm.tsx | 2 +- .../survey-sale/detail/RoofForm.tsx | 2 +- 3 files changed, 14 insertions(+), 31 deletions(-) diff --git a/src/app/api/survey-sales/route.ts b/src/app/api/survey-sales/route.ts index 96cfce4..551ad0b 100644 --- a/src/app/api/survey-sales/route.ts +++ b/src/app/api/survey-sales/route.ts @@ -78,29 +78,6 @@ const createKeywordSearchCondition = (keyword: string, searchOption: string): Wh return where } -// 임시저장 데이터 필터링 - T01 만 적용 -const filterTempData = () => { - const requiredFields = [ - 'INSTALLATION_SYSTEM', - 'CONSTRUCTION_YEAR', - 'RAFTER_SIZE', - 'RAFTER_PITCH', - 'WATERPROOF_MATERIAL', - 'INSULATION_PRESENCE', - 'STRUCTURE_ORDER', - ] - - return { - DETAIL_INFO: { - is: { - AND: requiredFields.map((field: string) => ({ - OR: [{ [field]: { not: null } }, { [`${field}_ETC`]: { not: null } }], - })), - }, - }, - } -} - /** * 회원 역할별 검색 조건 생성 함수 * @param params 검색 파라미터 @@ -155,14 +132,20 @@ const createMemberRoleCondition = (params: SearchParams): WhereCondition => { break case 'T01': - // where.AND.push(filterTempData()) - where.AND?.push({ - NOT: { - SRL_NO: { - startsWith: '一時保存', + where.OR = [ + { + NOT: { + SRL_NO: { + startsWith: '一時保存', + }, }, }, - }) + { + STORE: { + equals: params.store, + }, + }, + ] break case 'User': // 모든 매물 조회 가능 (추가 조건 없음) diff --git a/src/components/survey-sale/detail/ButtonForm.tsx b/src/components/survey-sale/detail/ButtonForm.tsx index c179fb7..8f8e3dd 100644 --- a/src/components/survey-sale/detail/ButtonForm.tsx +++ b/src/components/survey-sale/detail/ButtonForm.tsx @@ -219,7 +219,7 @@ export default function ButtonForm(props: { - + {session?.role !== 'T01' && }{' '} )} diff --git a/src/components/survey-sale/detail/RoofForm.tsx b/src/components/survey-sale/detail/RoofForm.tsx index 26228dd..3018296 100644 --- a/src/components/survey-sale/detail/RoofForm.tsx +++ b/src/components/survey-sale/detail/RoofForm.tsx @@ -636,7 +636,7 @@ const RadioSelected = ({ )} - {showEtcOption && ( + {(showEtcOption || column === 'insulationPresence') && (