Browse Source

laanc areaType 수정

pull/2/head
김장현 11 months ago
parent
commit
c0963121c1
  1. 21
      src/modules/cstmrService/inquiry/action/index.ts
  2. 11
      src/modules/cstmrService/inquiry/apis/index.ts
  3. 11
      src/modules/cstmrService/inquiry/model/index.ts
  4. 15
      src/modules/cstmrService/inquiry/reducers/index.ts
  5. 40
      src/modules/cstmrService/inquiry/sagas/index.ts
  6. 2
      src/views/laanc/FlightArea.js
  7. 9
      src/views/laanc/LaancStep1.js

21
src/modules/cstmrService/inquiry/action/index.ts

@ -0,0 +1,21 @@
import { AxiosError } from 'axios';
import { createAsyncAction, ActionType, createAction } from 'typesafe-actions';
import { IQnaAdminSearch, IQnaAdminList } from '../model';
// 목록 조회
const ADMIN_LIST_REQUEST = 'cstmrService/qna/ADMIN_LIST_REQUEST';
const ADMIN_LIST_SUCCESS = 'cstmrService/qna/ADMIN_LIST_SUCCESS';
const ADMIN_LIST_FAILURE = 'cstmrService/qna/ADMIN_LIST_FAILURE';
export const ADMIN_LIST = createAsyncAction(
ADMIN_LIST_REQUEST,
ADMIN_LIST_SUCCESS,
ADMIN_LIST_FAILURE
)<IQnaAdminSearch, IQnaAdminList[], AxiosError>();
const actions = {
ADMIN_LIST
};
export type QnaAction = ActionType<typeof actions>;

11
src/modules/cstmrService/inquiry/apis/index.ts

@ -0,0 +1,11 @@
import axios from '../../../utils/customAxiosUtil';
export const qnaAPI = {
adminList: async ({ category, searchType, word }) => {
// const url =
// category === '전체'
// ? `api/bas/cns/faq?word=${word}`
// : `api/bas/cns/faq?category=${category}&word=${word}`;
return await axios.get(``);
}
};

11
src/modules/cstmrService/inquiry/model/index.ts

@ -0,0 +1,11 @@
export interface IQnaState {
adminList: [];
}
export interface IQnaAdminList {}
export interface IQnaAdminSearch {
category: string;
searchType: string;
word: string;
}

15
src/modules/cstmrService/inquiry/reducers/index.ts

@ -0,0 +1,15 @@
import { createReducer } from 'typesafe-actions';
import produce from 'immer';
import * as Actions from '../action';
import { IQnaState } from '../model';
export const faqReducer = createReducer<IQnaState, Actions.QnaAction>({
adminList: []
})
// 목록
.handleAction(Actions.ADMIN_LIST.success, (state, action) =>
produce(state, draft => {
const data = action.payload;
// draft.adminList = data;
})
);

40
src/modules/cstmrService/inquiry/sagas/index.ts

@ -0,0 +1,40 @@
import { call, put, takeEvery } from '@redux-saga/core/effects';
import { ActionType } from 'typesafe-actions';
import {
DELETE_MESSAGE,
DUPLATE_MESSAGE,
ERROR_MESSAGE,
SAVE_MESSAGE
} from '../../../../configs/constants';
import * as MessageActions from '../../../comn/message/actions/comnMessageAction';
import * as Actions from '../action';
import * as Apis from '../apis';
function* adminListSaga(action: ActionType<typeof Actions.ADMIN_LIST.request>) {
try {
const payload = action.payload;
const res = yield call(Apis.qnaAPI.adminList, payload);
const { data, count, errorCode } = res;
if (errorCode) {
// 오류메시지 호출
yield put(
MessageActions.IS_ERROR({
errorCode: errorCode,
errorMessage: '처리중 오류가 발생하였습니다',
isHistoryBack: false,
isRefresh: false
})
);
return;
}
yield put(Actions.ADMIN_LIST.success(data));
} catch (error) {
yield put(Actions.ADMIN_LIST.failure(error));
}
}
export function* faqSaga() {
yield takeEvery(Actions.ADMIN_LIST.request, adminListSaga);
}

2
src/views/laanc/FlightArea.js

@ -481,7 +481,7 @@ export default function FlightArea({
handleChange({
type: 'area',
name: 'areaType',
value: mapControl.drawType
value: areas.areaType
});
}
);

9
src/views/laanc/LaancStep1.js

@ -579,7 +579,6 @@ export default function LaancStep1({
</FormGroup>
</Col>
<Col className='list-input' md='6'>
{console.log('>>>>>>>>>', data)}
<FormGroup>
<Label for='test'>
<span className='necessary'>*</span>
@ -605,7 +604,13 @@ export default function LaancStep1({
innerRef={bufferZoneRef} // Input 요소에 ref를 연결
onClick={() => handleInputClick('bufferZone')}
placeholder='100m'
disabled={data.areaList[0].areaType !== 'LINE'}
disabled={
!areaCoordList
? true
: areaCoordList[0].areaType !== 'LINE'
? true
: false
}
/>
</FormGroup>
</Col>

Loading…
Cancel
Save