Prechádzať zdrojové kódy

Fix missing vuex parameter so that error alert can be shown

sbkwgh 8 rokov pred
rodič
commit
7c7dc7d45d

+ 1 - 1
src/components/ReportPostModal.vue

@@ -71,7 +71,7 @@
 						})
 						.catch(e => {
 							this.loading  = false
-							AjaxErrorHandler()(e)
+							AjaxErrorHandler(this.$store)(e)
 						})
 				}
 

+ 5 - 4
src/components/routes/AdminModerationReports.vue

@@ -46,6 +46,7 @@
 					<button class='button button--red' @click='removePost(report, $index)'>Remove post</button>
 					<menu-button
 						@delete='deleteReport(report.id, $index)'
+						@ban='banUser(report, $index)'
 						:options='reportMenuOptions'
 					>
 						<button class='button'>More options&hellip;</button>
@@ -86,7 +87,7 @@
 			return {
 				reportMenuOptions: [
 					{ value: "Delete report", event: 'delete' },
-					{ value: "Ban or block user" },
+					{ value: "Ban or block user", event: 'ban' },
 					{ value: "Remove thread" }
 				],
 				reports: [],
@@ -105,7 +106,7 @@
 					.then(_ => {
 						this.reports.splice(index, 1)
 					})
-					.catch(AjaxErrorHandler())
+					.catch(AjaxErrorHandler(this.$store))
 			},
 			removePost (report, index) {
 				if(report) {
@@ -122,7 +123,7 @@
 						.then(_ => {
 							this.reports.splice(this.removePostObj.index, 1)
 						})
-						.catch(AjaxErrorHandler())
+						.catch(AjaxErrorHandler(this.$store))
 				}
 			
 			}
@@ -135,7 +136,7 @@
 				.then(res => {
 					this.reports = res.data
 				})
-				.catch(AjaxErrorHandler())
+				.catch(AjaxErrorHandler(this.$store))
 		}
 	}
 </script>