Ursprung
a7e961fc0c
Commit
f5332411d2
@ -43,8 +43,6 @@
|
||||
let member = $state(event.maxTeamMembers);
|
||||
let schemType = $state(event.schemType);
|
||||
let publicOnly = $state(event.publicSchemsOnly);
|
||||
let addReferee: {name: string, id: number}[] = [];
|
||||
let removeReferee: {name: string, id: number}[] = [];
|
||||
|
||||
let errorOpen = $state(false);
|
||||
let error: any = $state(undefined);
|
||||
@ -69,9 +67,7 @@
|
||||
endDate.diff(dayjs(event.end)) !== 0 ||
|
||||
member !== event.maxTeamMembers ||
|
||||
schemType != event.schemType ||
|
||||
publicOnly !== event.publicSchemsOnly ||
|
||||
addReferee.length > 0 ||
|
||||
removeReferee.length > 0);
|
||||
publicOnly !== event.publicSchemsOnly);
|
||||
|
||||
|
||||
async function del() {
|
||||
@ -95,8 +91,8 @@
|
||||
publicSchemsOnly: publicOnly,
|
||||
schemType: schemType ?? "null",
|
||||
start: startDate,
|
||||
addReferee: addReferee.map((ref) => ref.id),
|
||||
removeReferee: removeReferee.map((ref) => ref.id)
|
||||
addReferee: [],
|
||||
removeReferee: []
|
||||
};
|
||||
|
||||
try {
|
||||
|
@ -43,6 +43,14 @@
|
||||
async function addReferee() {
|
||||
if (selectedPlayer) {
|
||||
referees = (await $eventRepo.updateEvent(data.event.id.toString(), {
|
||||
deadline: null,
|
||||
end: null,
|
||||
maxTeamMembers: null,
|
||||
name: null,
|
||||
publicSchemsOnly: null,
|
||||
removeReferee: null,
|
||||
schemType: null,
|
||||
start: null,
|
||||
addReferee: [selectedPlayer]
|
||||
})).referees;
|
||||
}
|
||||
@ -53,7 +61,15 @@
|
||||
function removeReferee(id: string) {
|
||||
return async () => {
|
||||
referees = (await $eventRepo.updateEvent(data.event.id.toString(), {
|
||||
removeReferee: [id]
|
||||
deadline: null,
|
||||
end: null,
|
||||
maxTeamMembers: null,
|
||||
name: null,
|
||||
publicSchemsOnly: null,
|
||||
addReferee: null,
|
||||
schemType: null,
|
||||
start: null,
|
||||
removeReferee: [id],
|
||||
})).referees;
|
||||
}
|
||||
}
|
||||
|
@ -31,15 +31,15 @@ export interface CreateEvent {
|
||||
}
|
||||
|
||||
export interface UpdateEvent {
|
||||
name?: string;
|
||||
start?: Dayjs;
|
||||
end?: Dayjs;
|
||||
deadline?: Dayjs;
|
||||
maxTeamMembers?: number;
|
||||
schemType?: string | null;
|
||||
publicSchemsOnly?: boolean;
|
||||
addReferee?: string[];
|
||||
removeReferee?: string[];
|
||||
name: string | null;
|
||||
start: Dayjs | null;
|
||||
end: Dayjs | null;
|
||||
deadline: Dayjs | null;
|
||||
maxTeamMembers: number | null;
|
||||
schemType: string | null;
|
||||
publicSchemsOnly: boolean | null;
|
||||
addReferee: string[] | null;
|
||||
removeReferee: string[] | null;
|
||||
}
|
||||
|
||||
export class EventRepo {
|
||||
|
Laden…
x
In neuem Issue referenzieren
Einen Benutzer sperren