mobilizon.chapril.org-mobil.../js/src/types/actor/person.model.ts
Thomas Citharel 757d2cabec
Add a dropdown on participate menu, disallow listing participations
Now requires quering the person endpoint to know if an actor
participates in an event, organizers can make authenticated requests to
event { participants { } } to see the pending / approved participants.

Also closes #174

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2019-09-26 17:00:01 +02:00

32 lines
709 B
TypeScript

import { ICurrentUser } from '@/types/current-user.model';
import { IEvent, IParticipant } from '@/types/event.model';
import { Actor, IActor } from '@/types/actor/actor.model';
export interface IFeedToken {
token: string;
actor?: IPerson;
user: ICurrentUser;
}
export interface IPerson extends IActor {
feedTokens: IFeedToken[];
goingToEvents: IEvent[];
participations: IParticipant[];
}
export class Person extends Actor implements IPerson {
feedTokens: IFeedToken[] = [];
goingToEvents: IEvent[] = [];
participations: IParticipant[] = [];
constructor(hash: IPerson | {} = {}) {
super(hash);
this.patch(hash);
}
patch (hash: any) {
Object.assign(this, hash);
}
}