|
|
@ -5,8 +5,7 @@ import { createAsyncAction, ActionType, createAction } from 'typesafe-actions'; |
|
|
|
* 대문자와 _를 사용하여 상수 형태로 작성한다. |
|
|
|
* 대문자와 _를 사용하여 상수 형태로 작성한다. |
|
|
|
* 구분자는 소문자로 작성한다. |
|
|
|
* 구분자는 소문자로 작성한다. |
|
|
|
* 동사를 먼저 작성한다. |
|
|
|
* 동사를 먼저 작성한다. |
|
|
|
* 비동기 요청 액션이 아닐 땐 DISPATCH_ 로 시작한다. |
|
|
|
* 비동기 요청 액션이 아닐 땐 CLIENT_ 로 시작한다. |
|
|
|
* 목록 안에 상세 목록이 존재할 경우(ex. 비행이력) 상세 목록은 LOG로 작성한다. |
|
|
|
|
|
|
|
* |
|
|
|
* |
|
|
|
* 기본 규칙 |
|
|
|
* 기본 규칙 |
|
|
|
* 목록 조회 - GET_[주체]_LIST |
|
|
|
* 목록 조회 - GET_[주체]_LIST |
|
|
@ -15,12 +14,16 @@ import { createAsyncAction, ActionType, createAction } from 'typesafe-actions'; |
|
|
|
* 수정/변경 - UPDATE_[주체] |
|
|
|
* 수정/변경 - UPDATE_[주체] |
|
|
|
* 삭제 - DELETE_[주체] |
|
|
|
* 삭제 - DELETE_[주체] |
|
|
|
* |
|
|
|
* |
|
|
|
|
|
|
|
* [동사] |
|
|
|
|
|
|
|
* SET, FIND, SEND, CHECK, REGISTER ... |
|
|
|
|
|
|
|
* [명사] |
|
|
|
|
|
|
|
* LIST, DETAIL, LOG, APPROVAL ... |
|
|
|
|
|
|
|
* |
|
|
|
* |
|
|
|
* |
|
|
|
* [Action 함수] |
|
|
|
* [Action 함수] |
|
|
|
* 카멜케이스를 사용하여 작성한다. |
|
|
|
* 카멜케이스를 사용하여 작성한다. |
|
|
|
* 작성한 Action 타입을 참고하여 작성한다. (Ex. GET_DRONE_LIST_REQUEST -> getDroneList) |
|
|
|
* 작성한 Action 타입을 참고하여 작성한다. (Ex. GET_DRONE_LIST_REQUEST -> getDroneList) |
|
|
|
* 비동기 Action 함수는.. dispatch.. 빼줄까? 너무길어요.. |
|
|
|
* |
|
|
|
* 비동기 요청 액션이 아닐 땐 createAction을 사용한다. |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
// 드론 목록
|
|
|
|
// 드론 목록
|
|
|
@ -29,13 +32,13 @@ const GET_DRONE_LIST_SUCCESS = 'sample/GET_DRONE_LIST_SUCCESS'; |
|
|
|
const GET_DRONE_LIST_FAILURE = 'sample/GET_DRONE_LIST_FAILURE'; |
|
|
|
const GET_DRONE_LIST_FAILURE = 'sample/GET_DRONE_LIST_FAILURE'; |
|
|
|
|
|
|
|
|
|
|
|
// 지도 타입
|
|
|
|
// 지도 타입
|
|
|
|
const DISPATCH_MAPTYPE = 'sample/DISPATCH_MAPTYPE'; |
|
|
|
const CLIENT_MAPTYPE = 'sample/CLIENT_MAPTYPE'; |
|
|
|
|
|
|
|
|
|
|
|
// 비행 이력 목록
|
|
|
|
// 비행 이력 목록
|
|
|
|
const HISTORY_LIST_REQUEST = 'sample/HISTORY_LIST_REQUEST'; |
|
|
|
const GET_HISTORY_LIST_REQUEST = 'sample/HISTORY_LIST_REQUEST'; |
|
|
|
|
|
|
|
|
|
|
|
// 비행 이력 상세 목록
|
|
|
|
// 비행 이력 상세 목록
|
|
|
|
const HISTORY_LOG_REQUEST = 'sample/HISTORY_LOG_REQUEST'; |
|
|
|
const GET_HISTORY_LOG_REQUEST = 'sample/HISTORY_LOG_REQUEST'; |
|
|
|
|
|
|
|
|
|
|
|
export const getDroneList = createAsyncAction( |
|
|
|
export const getDroneList = createAsyncAction( |
|
|
|
GET_DRONE_LIST_REQUEST, |
|
|
|
GET_DRONE_LIST_REQUEST, |
|
|
@ -43,7 +46,7 @@ export const getDroneList = createAsyncAction( |
|
|
|
GET_DRONE_LIST_FAILURE |
|
|
|
GET_DRONE_LIST_FAILURE |
|
|
|
)(); |
|
|
|
)(); |
|
|
|
|
|
|
|
|
|
|
|
export const mapType = createAction(DISPATCH_MAPTYPE)(); |
|
|
|
export const clientMapType = createAction(CLIENT_MAPTYPE)(); |
|
|
|
|
|
|
|
|
|
|
|
const actions = { |
|
|
|
const actions = { |
|
|
|
getDroneList |
|
|
|
getDroneList |
|
|
|