From b28402f7a773fd04b2e99546ef16f64316d0753a Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 17 May 2021 11:36:36 +0200 Subject: [PATCH] Report list fixes Signed-off-by: Thomas Citharel --- js/src/views/Moderation/Report.vue | 8 +++++--- js/src/views/Moderation/ReportList.vue | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/js/src/views/Moderation/Report.vue b/js/src/views/Moderation/Report.vue index c8635671d..29682b941 100644 --- a/js/src/views/Moderation/Report.vue +++ b/js/src/views/Moderation/Report.vue @@ -480,13 +480,15 @@ export default class Report extends Vue { ); return; } - const updatedReport = data.updateReportStatus; - report.status = updatedReport.status; + const updatedReport = { + ...report, + status: data.updateReportStatus.status, + }; store.writeQuery({ query: REPORT, variables: { id: this.report.id }, - data: { report }, + data: { report: updatedReport }, }); }, }); diff --git a/js/src/views/Moderation/ReportList.vue b/js/src/views/Moderation/ReportList.vue index c88e7e10a..928e19c35 100644 --- a/js/src/views/Moderation/ReportList.vue +++ b/js/src/views/Moderation/ReportList.vue @@ -90,7 +90,7 @@ import VueRouter from "vue-router"; import { Paginate } from "@/types/paginate"; const { isNavigationFailure, NavigationFailureType } = VueRouter; -const REPORT_PAGE_LIMIT = 1; +const REPORT_PAGE_LIMIT = 10; @Component({ components: { @@ -99,6 +99,7 @@ const REPORT_PAGE_LIMIT = 1; }, apollo: { reports: { + fetchPolicy: "cache-and-network", query: REPORTS, variables() { return {