diff --git a/public/react/src/modules/courses/coursesPublic/AppraiseModal.js b/public/react/src/modules/courses/coursesPublic/AppraiseModal.js index f1ee18bb7..120e57b2b 100644 --- a/public/react/src/modules/courses/coursesPublic/AppraiseModal.js +++ b/public/react/src/modules/courses/coursesPublic/AppraiseModal.js @@ -72,9 +72,8 @@ class AppraiseModal extends Component{ challenge_id:challenge_id }).then((response) => { if(response.data.status===0){ - debugger - this.props.showNotification(response.data.message) this.props.showCancel(comment,hidden_comment,challenge_id,response.data.comment_id) + this.props.showNotification(response.data.message) }else{ this.props.showNotification(response.data.message) } diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index 0f1264865..bb8ccae4a 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -216,10 +216,13 @@ class ShixunWorkReport extends Component { } isdeleteModal=(comment_id,visible_comment,type)=>{ + let newcomment_id=comment_id; + let newvisible_comment=visible_comment; + let newtype=type; this.setState({ modalsType: true, modalsTopval:"是否确认删除?", - modalSave: ()=>this.isdeleteModals(comment_id,visible_comment,type), + modalSave: ()=>this.isdeleteModals(newcomment_id,newvisible_comment,newtype), modalCancel:()=>this.hideisdeleteModals(), }) } @@ -278,22 +281,24 @@ class ShixunWorkReport extends Component { let newcomment_id=comment_id; let newvisible_comment=visible_comment; let newtype=type; + if(comment_id!=null){ + let url =`/student_works/${this.props.match.params.homeworkid}/destroy_work_comment.json` + axios.delete(url, { data: { + comment_id:comment_id, + }}).then((response) => { + // const { status } = response.data; + if(response.data.status===0){ + this.props.showNotification(response.data.message) + this.hideisdeleteModal(newcomment_id,newvisible_comment,newtype) + }else{ + this.props.showNotification(response.data.message) + } + }) + .catch(function (error) { + console.log(error); + }); + } - let url =`/student_works/${this.props.match.params.homeworkid}/destroy_work_comment.json` - axios.delete(url, { data: { - comment_id:comment_id, - }}).then((response) => { - // const { status } = response.data; - if(response.data.status===0){ - this.props.showNotification(response.data.message) - this.hideisdeleteModal(newcomment_id,newvisible_comment,newtype) - }else{ - this.props.showNotification(response.data.message) - } - }) - .catch(function (error) { - console.log(error); - }); } render() { let{data,showAppraiseModaltype,work_comment_hidden,work_comment} =this.state;