소스 검색

Don't remove reports with another api request since they are already removed on the backend, simply update the ui

sbkwgh 7 년 전
부모
커밋
ecb9e5309d
1개의 변경된 파일9개의 추가작업 그리고 2개의 파일을 삭제
  1. 9 2
      frontend/src/components/routes/AdminModerationReports.vue

+ 9 - 2
frontend/src/components/routes/AdminModerationReports.vue

@@ -129,10 +129,17 @@
 
 					this.removePostObj.showThreadDeleteModal = true
 				} else {
+					let threadId = this.removePostObj.report.Post.Thread.id
+
 					this.axios
-						.delete('/api/v1/thread/' + this.removePostObj.report.Post.Thread.id)
+						.delete('/api/v1/thread/' + threadId)
 						.then(() => {
-							return this.deleteReport(this.removePostObj.report.id, this.removePostObj.index)
+							//Get reports with id of deleted thread
+							//and remove them locally
+							this.reports = this.reports.filter(report => {
+								return report.Post.Thread.id !== threadId
+							})
+
 						})
 						.catch(AjaxErrorHandler(this.$store))
 				}