Skip to content

Commit 9e57500

Browse files
committed
add handleapprove in chaincode.js
Signed-off-by: YoungHypo <[email protected]>
1 parent cb4e957 commit 9e57500

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

src/dashboard/src/pages/ChainCode/ChainCode.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,16 @@ class ChainCode extends PureComponent {
140140
});
141141
};
142142

143+
handleApprove = (values, callback) => {
144+
const { dispatch } = this.props;
145+
146+
dispatch({
147+
type: 'chainCode/approveChainCode',
148+
payload: values,
149+
callback,
150+
});
151+
};
152+
143153
onUploadChainCode = () => {
144154
this.handleModalVisible(true);
145155
};
@@ -192,6 +202,7 @@ class ChainCode extends PureComponent {
192202

193203
const approveFormProps = {
194204
approveModalVisible,
205+
handleApprove: this.handleApprove,
195206
handleApproveModalVisible: this.handleApproveModalVisible,
196207
fetchChainCodes: this.fetchChainCodes,
197208
approving,

src/dashboard/src/pages/ChainCode/forms/ApproveForm.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const ApproveForm = props => {
1212
const [channels, setChannels] = useState([]);
1313
const {
1414
approveModalVisible,
15+
handleApprove,
1516
handleApproveModalVisible,
1617
approving,
1718
fetchChainCodes,
@@ -31,16 +32,6 @@ const ApproveForm = props => {
3132
fetchData();
3233
}, []);
3334

34-
handleApprove = (values, callback) => {
35-
const { dispatch } = this.props;
36-
37-
dispatch({
38-
type: 'chainCode/approveChainCode',
39-
payload: values,
40-
callback,
41-
});
42-
};
43-
4435
const approveCallback = response => {
4536
if (response.status !== 'successful') {
4637
message.error(

0 commit comments

Comments
 (0)