Event edit and participant fixes
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -42,6 +42,7 @@ interface IEventEditJSON {
|
||||
draft: boolean;
|
||||
picture?: IMedia | { mediaId: string } | null;
|
||||
attributedToId: string | null;
|
||||
organizerActorId?: string;
|
||||
onlineAddress?: string;
|
||||
phoneAddress?: string;
|
||||
physicalAddress?: IAddress;
|
||||
@@ -209,8 +210,8 @@ export class EventModel implements IEvent {
|
||||
tags: this.tags.map((t) => t.title),
|
||||
onlineAddress: this.onlineAddress,
|
||||
phoneAddress: this.phoneAddress,
|
||||
physicalAddress: this.physicalAddress,
|
||||
options: this.options,
|
||||
physicalAddress: this.removeTypeName(this.physicalAddress),
|
||||
options: this.removeTypeName(this.options),
|
||||
attributedToId:
|
||||
this.attributedTo && this.attributedTo.id ? this.attributedTo.id : null,
|
||||
contacts: this.contacts.map(({ id }) => ({
|
||||
@@ -218,4 +219,13 @@ export class EventModel implements IEvent {
|
||||
})),
|
||||
};
|
||||
}
|
||||
|
||||
private removeTypeName(entity: any): any {
|
||||
if (entity?.__typename) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const { __typename, ...purgedEntity } = entity;
|
||||
return purgedEntity;
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user