diff --git a/src/ts/@overflow/target/react/TargetDetail.tsx b/src/ts/@overflow/target/react/TargetDetail.tsx index c0c11d1..a0ceb56 100644 --- a/src/ts/@overflow/target/react/TargetDetail.tsx +++ b/src/ts/@overflow/target/react/TargetDetail.tsx @@ -5,6 +5,8 @@ import { DispatchProps as DispatchProps, } from './components/TargetDetail'; +import * as targetDetailActions from '../redux/action/read'; + export function mapStateToProps(state: any): StateProps { return { probe: state.probe, @@ -13,6 +15,9 @@ export function mapStateToProps(state: any): StateProps { export function mapDispatchToProps(dispatch: Dispatch): DispatchProps { return { + onRead: (id: string) => { + dispatch(targetDetailActions.request(id)); + }, }; } diff --git a/src/ts/@overflow/target/react/components/TargetDetail.tsx b/src/ts/@overflow/target/react/components/TargetDetail.tsx index 2f108e7..d5d3f6c 100644 --- a/src/ts/@overflow/target/react/components/TargetDetail.tsx +++ b/src/ts/@overflow/target/react/components/TargetDetail.tsx @@ -13,7 +13,7 @@ export interface StateProps { } export interface DispatchProps { - + onRead(id: string): void; } export type Props = StateProps & DispatchProps; diff --git a/src/ts/@overflow/target/react/components/TargetList.tsx b/src/ts/@overflow/target/react/components/TargetList.tsx index 5c47d1c..bdb2ba2 100644 --- a/src/ts/@overflow/target/react/components/TargetList.tsx +++ b/src/ts/@overflow/target/react/components/TargetList.tsx @@ -23,7 +23,7 @@ export interface State { export class TargetList extends React.Component { - private data: any; + private data: any; constructor(props: Props, context: State) { super(props, context); this.state = { @@ -34,7 +34,6 @@ export class TargetList extends React.Component { } public handleAddTarget(event: React.MouseEvent, data: ButtonProps): void { - alert('test'); this.setState({ openAddTarget: true, });