Ver código fonte

Fixed minor issue with resolving inside the issues modal

theflametrooper 8 anos atrás
pai
commit
3269a2f0b2

+ 3 - 3
frontend/components/Admin/Reports.vue

@@ -26,7 +26,7 @@
 							<span>{{ report.description }}</span>
 						</td>
 						<td>
-							<a class='button is-warning' @click='toggleModal(report.issues)'>Issues</a>
+							<a class='button is-warning' @click='toggleModal(report)'>Issues</a>
 							<a class='button is-primary' @click='resolve(report._id)'>Resolve</a>
 						</td>
 					</tr>
@@ -55,9 +55,9 @@
 			init: function() {
 				this.socket.emit('apis.joinAdminRoom', 'reports', data => {});
 			},
-			toggleModal: function (issues) {
+			toggleModal: function (report) {
 				this.isModalActive = !this.isModalActive;
-				if (this.isModalActive) this.currentReport = issues;
+				if (this.isModalActive) this.currentReport = report;
 			},
 			resolve: function (reportId) {
 				this.socket.emit('reports.resolve', reportId, res => {

+ 2 - 2
frontend/components/Modals/IssuesModal.vue

@@ -16,7 +16,7 @@
 						</tr>
 					</thead>
 					<tbody>
-						<tr v-for='(index, issue) in $parent.currentReport' track-by='$index'>
+						<tr v-for='(index, issue) in $parent.currentReport.issues' track-by='$index'>
 							<td>
 								<span>{{ issue.name }}</span>
 							</td>
@@ -29,7 +29,7 @@
 
 			</section>
 			<footer class='modal-card-foot'>
-				<a class='button is-primary' @click='$parent.resolve()'>
+				<a class='button is-primary' @click='$parent.resolve($parent.currentReport._id)'>
 					<span>Resolve</span>
 				</a>
 				<a class='button is-danger' @click='$parent.toggleModal()'>