Fixed group activities and added collapsing for general settings
This commit is contained in:
@@ -144,7 +144,7 @@ class DiaryDateActivityService {
|
||||
diaryDateId,
|
||||
isTimeblock: true,
|
||||
},
|
||||
order: [['order_id', 'ASC']],
|
||||
order: [['order_id', 'DESC']],
|
||||
limit: 1
|
||||
});
|
||||
if (!diaryDateActivity) {
|
||||
|
||||
@@ -22,7 +22,7 @@ class DiaryService {
|
||||
{ model: DiaryNote, as: 'diaryNotes' }, // Der Alias für DiaryNote ist korrekt
|
||||
{ model: DiaryTag, as: 'diaryTags' }, // Hier muss der Alias auf 'diaryTags' geändert werden
|
||||
],
|
||||
order: [['date', 'ASC'], ['trainingStart', 'ASC']]
|
||||
order: [['date', 'DESC'], ['trainingStart', 'ASC']]
|
||||
});
|
||||
return dates;
|
||||
}
|
||||
|
||||
@@ -38,6 +38,25 @@ class GroupService {
|
||||
});
|
||||
return groups;
|
||||
}
|
||||
|
||||
async changeGroup(userToken, groupId, clubId, dateId, name, lead) {
|
||||
console.log("changeGroup: ", groupId, clubId, dateId, name, lead);
|
||||
await checkAccess(userToken, clubId);
|
||||
await this.checkDiaryDateToClub(clubId, dateId);
|
||||
const group = await Group.findOne({
|
||||
where: {
|
||||
id: groupId,
|
||||
diaryDateId: dateId
|
||||
}
|
||||
});
|
||||
if (!group) {
|
||||
throw new HttpError('Gruppe nicht gefunden oder passt nicht zum angegebenen Datum und Verein', 404);
|
||||
}
|
||||
group.name = name;
|
||||
group.lead = lead;
|
||||
await group.save();
|
||||
return group;
|
||||
}
|
||||
}
|
||||
|
||||
export default new GroupService();
|
||||
Reference in New Issue
Block a user