Fixed profile suspension

Closes #749

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2021-06-30 18:04:01 +02:00
parent 909a1030ef
commit 4c5eb58aa7
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773
3 changed files with 12 additions and 2 deletions

View File

@ -164,7 +164,7 @@ function doMerge<T = any>(
incoming: Array<T>,
args: Record<string, any> | null
): Array<T> {
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.

View File

@ -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,
},
});

View File

@ -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: "",