.
This commit is contained in:
parent
513a3a1056
commit
dd4448524d
|
@ -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<RegistPayload>;
|
||||
export type requestSuccess = (target: Target) => Action<Target>;
|
||||
export type requestFailure = (error: Error) => Action;
|
||||
|
||||
|
||||
|
||||
export const request: request = (probe: Probe, infra: Infra): Action<RegistPayload> => {
|
||||
return {
|
||||
type: REQUEST,
|
||||
payload: {
|
||||
probe: probe,
|
||||
infra: infra,
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export const requestSuccess: requestSuccess = (apiKey: ApiKey): Action<ApiKey> => {
|
||||
return {
|
||||
type: REQUEST_SUCCESS,
|
||||
payload: apiKey,
|
||||
};
|
||||
};
|
||||
|
||||
export const requestFailure: requestFailure = (error: Error): Action => {
|
||||
return {
|
||||
type: REQUEST_FAILURE,
|
||||
error: error,
|
||||
};
|
||||
};
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user