Refactor group ID handling in DiaryView and related services for consistency
Updated the handling of group IDs in DiaryView.vue to ensure they are consistently treated as strings. Enhanced the DiaryDateActivityService to filter out duplicate group activities and ensure proper handling of group IDs during updates. This improves data integrity and consistency across the application.
This commit is contained in:
@@ -208,6 +208,17 @@ class DiaryDateActivityService {
|
||||
|
||||
// Auch für GroupActivities
|
||||
if (activityData.groupActivities && activityData.groupActivities.length > 0) {
|
||||
const seenGroupActivityIds = new Set();
|
||||
activityData.groupActivities = activityData.groupActivities.filter(groupActivity => {
|
||||
if (!groupActivity || groupActivity.id === undefined || groupActivity.id === null) {
|
||||
return false;
|
||||
}
|
||||
if (seenGroupActivityIds.has(groupActivity.id)) {
|
||||
return false;
|
||||
}
|
||||
seenGroupActivityIds.add(groupActivity.id);
|
||||
return true;
|
||||
});
|
||||
for (const groupActivity of activityData.groupActivities) {
|
||||
if (groupActivity.groupPredefinedActivity) {
|
||||
// Hole die erste verfügbare Image-ID direkt aus der Datenbank
|
||||
|
||||
Reference in New Issue
Block a user