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>, incoming: Array<T>,
args: Record<string, any> | null args: Record<string, any> | null
): Array<T> { ): Array<T> {
const merged = existing ? existing.slice(0) : []; const merged = existing && Array.isArray(existing) ? existing.slice(0) : [];
let res; let res;
if (args) { if (args) {
// Assume an page of 1 if args.page omitted. // Assume an page of 1 if args.page omitted.

View file

@ -438,6 +438,10 @@ export default class AdminGroupProfile extends Vue {
query: GET_GROUP, query: GET_GROUP,
variables: { variables: {
id: profileId, 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 { ApolloCache, FetchResult } from "@apollo/client/core";
import VueRouter from "vue-router"; import VueRouter from "vue-router";
import { MemberRole } from "@/types/enums"; import { MemberRole } from "@/types/enums";
import cloneDeep from "lodash/cloneDeep";
const { isNavigationFailure, NavigationFailureType } = VueRouter; const { isNavigationFailure, NavigationFailureType } = VueRouter;
const EVENTS_PER_PAGE = 10; const EVENTS_PER_PAGE = 10;
@ -402,6 +403,10 @@ export default class AdminProfile extends Vue {
actorId: profileId, actorId: profileId,
organizedEventsPage: 1, organizedEventsPage: 1,
organizedEventsLimit: EVENTS_PER_PAGE, 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: { data: {
person: { person: {
...person, ...cloneDeep(person),
participations: { total: 0, elements: [] },
suspended: true, suspended: true,
avatar: null, avatar: null,
name: "", name: "",