[251015] feat: searchActions -> ShopperHouse API

🕐 커밋 시간: 2025. 10. 15. 20:42:14

📊 변경 통계:
  • 총 파일: 6개
  • 추가: +78줄
  • 삭제: -3줄

📁 추가된 파일:
  + com.twin.app.shoptime/shopperhounse_api.md

📝 수정된 파일:
  ~ com.twin.app.shoptime/src/actions/actionTypes.js
  ~ com.twin.app.shoptime/src/actions/searchActions.js
  ~ com.twin.app.shoptime/src/api/apiConfig.js
  ~ com.twin.app.shoptime/src/reducers/searchReducer.js
  ~ com.twin.app.shoptime/src/views/SearchPanel/VoiceInputOverlay/modes/VoicePromptScreen.jsx

🔧 함수 변경 내용:
  📄 com.twin.app.shoptime/src/actions/searchActions.js (javascript):
     Added: setInitPerformed(), onSuccess(), onFail()
  📄 com.twin.app.shoptime/shopperhounse_api.md (md파일):
     Added: Success()

🔧 주요 변경 내용:
  • 타입 시스템 안정성 강화
  • 핵심 비즈니스 로직 개선
  • API 서비스 레이어 개선
This commit is contained in:
2025-10-15 20:42:15 +09:00
parent 672d03ef3f
commit bce2de22b4
6 changed files with 286 additions and 171 deletions

View File

@@ -1,4 +1,4 @@
import { types } from "../actions/actionTypes";
import { types } from '../actions/actionTypes';
const initialState = {
searchDatas: {},
@@ -6,6 +6,8 @@ const initialState = {
searchPerformed: false,
initPerformed: false,
searchTimestamp: null,
shopperHouseData: null,
shopperHouseSearchId: null,
};
export const searchReducer = (state = initialState, action) => {
@@ -54,6 +56,20 @@ export const searchReducer = (state = initialState, action) => {
searchTimestamp: Date.now(),
};
case types.GET_SHOPPERHOUSE_SEARCH: {
const resultData = action.payload.data.result;
const results = resultData.results || [];
// searchId 추출 (첫 번째 result에서)
const searchId = results.length > 0 ? results[0].searchId : null;
return {
...state,
shopperHouseData: resultData,
shopperHouseSearchId: searchId,
};
}
default:
return state;
}