From dd4448524d1bc53023f33d0bf0177a46a673bdc4 Mon Sep 17 00:00:00 2001 From: insanity Date: Tue, 4 Jul 2017 13:14:50 +0900 Subject: [PATCH] . --- .../@overflow/target/redux/action/regist.ts | 45 +++++++++++++++++++ .../target/redux/payload/RegistPayload.ts | 12 +++-- 2 files changed, 54 insertions(+), 3 deletions(-) diff --git a/src/ts/@overflow/target/redux/action/regist.ts b/src/ts/@overflow/target/redux/action/regist.ts index e69de29..8dca3c8 100644 --- a/src/ts/@overflow/target/redux/action/regist.ts +++ b/src/ts/@overflow/target/redux/action/regist.ts @@ -0,0 +1,45 @@ +import Action from '@overflow/commons/redux/Action'; +import Target from '../../api/model/Target'; +import RegistPayload from '../payload/RegistPayload'; +import Infra from '@overflow/infra/api/model/Infra'; +import Probe from '@overflow/probe/api/model/Probe'; + +// Action Type +export type REQUEST = '@overflow/target/regist/REQUEST'; +export type REQUEST_SUCCESS = '@overflow/target/regist/REQUEST_SUCCESS'; +export type REQUEST_FAILURE = '@overflow/target/regist/REQUEST_FAILURE'; + +export const REQUEST: REQUEST = '@overflow/target/regist/REQUEST'; +export const REQUEST_SUCCESS: REQUEST_SUCCESS = '@overflow/target/regist/REQUEST_SUCCESS'; +export const REQUEST_FAILURE: REQUEST_FAILURE = '@overflow/target/regist/REQUEST_FAILURE'; + +// Action Creater +export type request = (probe: Probe, infra: Infra) => Action; +export type requestSuccess = (target: Target) => Action; +export type requestFailure = (error: Error) => Action; + + + +export const request: request = (probe: Probe, infra: Infra): Action => { + return { + type: REQUEST, + payload: { + probe: probe, + infra: infra, + }, + }; +}; + +export const requestSuccess: requestSuccess = (apiKey: ApiKey): Action => { + return { + type: REQUEST_SUCCESS, + payload: apiKey, + }; +}; + +export const requestFailure: requestFailure = (error: Error): Action => { + return { + type: REQUEST_FAILURE, + error: error, + }; +}; diff --git a/src/ts/@overflow/target/redux/payload/RegistPayload.ts b/src/ts/@overflow/target/redux/payload/RegistPayload.ts index 5c15c15..a11c90d 100644 --- a/src/ts/@overflow/target/redux/payload/RegistPayload.ts +++ b/src/ts/@overflow/target/redux/payload/RegistPayload.ts @@ -1,3 +1,9 @@ -/** - * Created by geek on 17. 7. 3. - */ +import Infra from '@overflow/infra/api/model/Infra'; +import Probe from '@overflow/probe/api/model/Probe'; + +interface RegistPayload { + infra: Infra; + probe: Probe; +} + +export default RegistPayload;