|
|
@ -1,4 +1,10 @@ |
|
|
|
import { call, put, select, takeEvery } from '@redux-saga/core/effects'; |
|
|
|
import { |
|
|
|
|
|
|
|
call, |
|
|
|
|
|
|
|
put, |
|
|
|
|
|
|
|
takeLatest, |
|
|
|
|
|
|
|
takeEvery, |
|
|
|
|
|
|
|
debounce |
|
|
|
|
|
|
|
} from '@redux-saga/core/effects'; |
|
|
|
import * as Actions from '../actions/laancActions'; |
|
|
|
import * as Actions from '../actions/laancActions'; |
|
|
|
import { ActionType } from 'typesafe-actions'; |
|
|
|
import { ActionType } from 'typesafe-actions'; |
|
|
|
import * as MessageActions from '../../comn/message/actions/comnMessageAction'; |
|
|
|
import * as MessageActions from '../../comn/message/actions/comnMessageAction'; |
|
|
@ -7,7 +13,7 @@ import { ERROR_MESSAGE, SAVE_MESSAGE } from '../../../configs/constants'; |
|
|
|
// pdf 연결
|
|
|
|
// pdf 연결
|
|
|
|
|
|
|
|
|
|
|
|
// laanc 승인 여부
|
|
|
|
// laanc 승인 여부
|
|
|
|
function* postApprovalsata( |
|
|
|
function* postApprovalSaga( |
|
|
|
action: ActionType<typeof Actions.LAANC_FLIGHT_Approval.request> |
|
|
|
action: ActionType<typeof Actions.LAANC_FLIGHT_Approval.request> |
|
|
|
) { |
|
|
|
) { |
|
|
|
try { |
|
|
|
try { |
|
|
@ -15,16 +21,6 @@ function* postApprovalsata( |
|
|
|
|
|
|
|
|
|
|
|
const res = yield call(Apis.laancApi.postApproval, detail); |
|
|
|
const res = yield call(Apis.laancApi.postApproval, detail); |
|
|
|
|
|
|
|
|
|
|
|
// const { data } = res;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// yield put(
|
|
|
|
|
|
|
|
// MessageActions.IS_MESSAGE({
|
|
|
|
|
|
|
|
// messageCode: SAVE_MESSAGE.code,
|
|
|
|
|
|
|
|
// message: SAVE_MESSAGE.message,
|
|
|
|
|
|
|
|
// isHistoryBack: true,
|
|
|
|
|
|
|
|
// isRefresh: false
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
yield put(Actions.LAANC_FLIGHT_Approval.success(res.data)); |
|
|
|
yield put(Actions.LAANC_FLIGHT_Approval.success(res.data)); |
|
|
|
} catch (error) { |
|
|
|
} catch (error) { |
|
|
|
yield put( |
|
|
|
yield put( |
|
|
@ -35,29 +31,16 @@ function* postApprovalsata( |
|
|
|
isRefresh: false |
|
|
|
isRefresh: false |
|
|
|
}) |
|
|
|
}) |
|
|
|
); |
|
|
|
); |
|
|
|
// yield put(Actions.FLIGHT_PLAN_CREATE.failure(error));
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// laanc 생성
|
|
|
|
// laanc 생성
|
|
|
|
function* postCreatesata( |
|
|
|
export function* postCreateSaga( |
|
|
|
action: ActionType<typeof Actions.LAANC_FLIGHT_CREATE.request> |
|
|
|
action: ActionType<typeof Actions.LAANC_FLIGHT_CREATE.request> |
|
|
|
) { |
|
|
|
) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
const detail = action.payload; |
|
|
|
const detail = action.payload; |
|
|
|
|
|
|
|
|
|
|
|
const res = yield call(Apis.laancApi.postCreate, detail); |
|
|
|
const res = yield call(Apis.laancApi.postCreate, detail); |
|
|
|
|
|
|
|
|
|
|
|
// const { data } = res;
|
|
|
|
|
|
|
|
// localStorage.setItem('pdfUrl', res.data.pdfUrl);
|
|
|
|
|
|
|
|
// yield put(
|
|
|
|
|
|
|
|
// MessageActions.IS_MESSAGE({
|
|
|
|
|
|
|
|
// messageCode: SAVE_MESSAGE.code,
|
|
|
|
|
|
|
|
// message: SAVE_MESSAGE.message,
|
|
|
|
|
|
|
|
// isHistoryBack: true,
|
|
|
|
|
|
|
|
// isRefresh: false
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
yield put(Actions.LAANC_FLIGHT_CREATE.success(res.data)); |
|
|
|
yield put(Actions.LAANC_FLIGHT_CREATE.success(res.data)); |
|
|
|
} catch (error) { |
|
|
|
} catch (error) { |
|
|
|
yield put( |
|
|
|
yield put( |
|
|
@ -68,9 +51,9 @@ function* postCreatesata( |
|
|
|
isRefresh: false |
|
|
|
isRefresh: false |
|
|
|
}) |
|
|
|
}) |
|
|
|
); |
|
|
|
); |
|
|
|
// yield put(Actions.FLIGHT_PLAN_CREATE.failure(error));
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// laanc 일물 일출
|
|
|
|
// laanc 일물 일출
|
|
|
|
function* getSunDataSaga( |
|
|
|
function* getSunDataSaga( |
|
|
|
action: ActionType<typeof Actions.LAANC_SUN_DATA.request> |
|
|
|
action: ActionType<typeof Actions.LAANC_SUN_DATA.request> |
|
|
@ -170,10 +153,10 @@ function* postValidAreaSaga( |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
export function* laancSaga() { |
|
|
|
export function* laancSaga() { |
|
|
|
yield takeEvery(Actions.LAANC_FLIGHT_Approval.request, postApprovalsata); |
|
|
|
yield takeEvery(Actions.LAANC_FLIGHT_Approval.request, postApprovalSaga); |
|
|
|
yield takeEvery(Actions.LAANC_FLIGHT_CREATE.request, postCreatesata); |
|
|
|
yield debounce(500, Actions.LAANC_FLIGHT_CREATE.request, postCreateSaga); |
|
|
|
yield takeEvery(Actions.LAANC_SUN_DATA.request, getSunDataSaga); |
|
|
|
yield takeEvery(Actions.LAANC_SUN_DATA.request, getSunDataSaga); |
|
|
|
yield takeEvery(Actions.LAANC_APRV_LIST.request, getAprvListSaga); |
|
|
|
yield debounce(500, Actions.LAANC_APRV_LIST.request, getAprvListSaga); |
|
|
|
yield takeEvery(Actions.LAANC_DETAIL.request, getDetailSaga); |
|
|
|
yield takeEvery(Actions.LAANC_DETAIL.request, getDetailSaga); |
|
|
|
yield takeEvery(Actions.LAANC_ALTITUDE.request, postValidElevSaga); |
|
|
|
yield takeEvery(Actions.LAANC_ALTITUDE.request, postValidElevSaga); |
|
|
|
yield takeEvery(Actions.LAANC_VALID_AREA.request, postValidAreaSaga); |
|
|
|
yield takeEvery(Actions.LAANC_VALID_AREA.request, postValidAreaSaga); |
|
|
|