forked from Gitlink/forgeplus-react
examine whether logged before claim
This commit is contained in:
parent
e8a658aa87
commit
dcfcca5799
|
|
@ -317,7 +317,7 @@ class Detail extends Component {
|
|||
<div className="list-left list-left-padding">
|
||||
<div className="list-right-item-padding background-f boder-4">
|
||||
|
||||
<Claims issue_id={orderId}/>
|
||||
<Claims issue_id={orderId} {...this.props} />
|
||||
|
||||
{/* <h1>hello in h1</h1> */}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ class claims extends React.Component {
|
|||
}
|
||||
getClaimers = ()=>{
|
||||
const {issue_id} = this.state;
|
||||
axios.get(`/issues/${issue_id}/claims`)
|
||||
axios.get(`/issues/${issue_id}/claims.json`)
|
||||
.then((result) => {
|
||||
if(result){
|
||||
console.log(result.data),
|
||||
|
|
@ -32,19 +32,24 @@ class claims extends React.Component {
|
|||
}
|
||||
|
||||
claimFun = (flag) => {
|
||||
const {issue_id} = this.state;
|
||||
axios({
|
||||
method: flag==1? 'delete' : 'post',
|
||||
url: `/issues/${issue_id}/claims`
|
||||
}).then(result => {
|
||||
this.setState({
|
||||
claimerdata: result.data.claimers,
|
||||
currentUserClaimed: result.data.currentUserclaimed
|
||||
if (this.props.checkIfLogin() === false) {
|
||||
this.props.showLoginDialog();
|
||||
return;
|
||||
} else {
|
||||
const {issue_id} = this.state;
|
||||
axios({
|
||||
method: flag==1? 'delete' : 'post',
|
||||
url: `/issues/${issue_id}/claims.json`
|
||||
}).then(result => {
|
||||
this.setState({
|
||||
claimerdata: result.data.claimers,
|
||||
currentUserClaimed: result.data.currentUserclaimed
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount = () => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue