From 4c5eb58aa72a23b1a9365c77565ec33dffb053ab Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 30 Jun 2021 18:04:01 +0200 Subject: [PATCH] Fixed profile suspension Closes #749 Signed-off-by: Thomas Citharel --- js/src/apollo/utils.ts | 2 +- js/src/views/Admin/AdminGroupProfile.vue | 4 ++++ js/src/views/Admin/AdminProfile.vue | 8 +++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/js/src/apollo/utils.ts b/js/src/apollo/utils.ts index 694db7d6e..917936c3a 100644 --- a/js/src/apollo/utils.ts +++ b/js/src/apollo/utils.ts @@ -164,7 +164,7 @@ function doMerge( incoming: Array, args: Record | null ): Array { - const merged = existing ? existing.slice(0) : []; + const merged = existing && Array.isArray(existing) ? existing.slice(0) : []; let res; if (args) { // Assume an page of 1 if args.page omitted. diff --git a/js/src/views/Admin/AdminGroupProfile.vue b/js/src/views/Admin/AdminGroupProfile.vue index 9a8e8a18b..b5a560d8c 100644 --- a/js/src/views/Admin/AdminGroupProfile.vue +++ b/js/src/views/Admin/AdminGroupProfile.vue @@ -438,6 +438,10 @@ export default class AdminGroupProfile extends Vue { query: GET_GROUP, variables: { id: profileId, + organizedEventsPage: this.organizedEventsPage, + organizedEventsLimit: EVENTS_PER_PAGE, + postsPage: this.postsPage, + postsLimit: POSTS_PER_PAGE, }, }); diff --git a/js/src/views/Admin/AdminProfile.vue b/js/src/views/Admin/AdminProfile.vue index 8f30cfa36..96ebf0a4f 100644 --- a/js/src/views/Admin/AdminProfile.vue +++ b/js/src/views/Admin/AdminProfile.vue @@ -275,6 +275,7 @@ import EmptyContent from "../../components/Utils/EmptyContent.vue"; import { ApolloCache, FetchResult } from "@apollo/client/core"; import VueRouter from "vue-router"; import { MemberRole } from "@/types/enums"; +import cloneDeep from "lodash/cloneDeep"; const { isNavigationFailure, NavigationFailureType } = VueRouter; const EVENTS_PER_PAGE = 10; @@ -402,6 +403,10 @@ export default class AdminProfile extends Vue { actorId: profileId, organizedEventsPage: 1, organizedEventsLimit: EVENTS_PER_PAGE, + participationsPage: 1, + participationLimit: PARTICIPATIONS_PER_PAGE, + membershipsPage: 1, + membershipsLimit: MEMBERSHIPS_PER_PAGE, }, }); @@ -414,7 +419,8 @@ export default class AdminProfile extends Vue { }, data: { person: { - ...person, + ...cloneDeep(person), + participations: { total: 0, elements: [] }, suspended: true, avatar: null, name: "",