Enhance diary note and tag management in backend controllers

Updated the diaryNoteController to require diaryDateId in note creation and improved error handling for missing fields. Enhanced the createTag function in diaryTagController to validate tag names and return appropriate responses. Additionally, refined the deleteTag function to ensure proper error handling when a tag is not found. These changes improve the robustness and usability of the diary management features.
This commit is contained in:
Torsten Schulz (local)
2025-11-11 08:29:18 +01:00
parent b8191e41ee
commit 20f204e70b
25 changed files with 1451 additions and 59 deletions

View File

@@ -26,7 +26,7 @@ class AutoFetchMatchResultsService {
autoUpdateRatings: true, // Nutze das gleiche Flag
savePassword: true // Must have saved password
},
attributes: ['id', 'userId', 'email', 'encryptedPassword', 'accessToken', 'expiresAt', 'cookie']
attributes: ['id', 'userId', 'email', 'savePassword', 'encryptedPassword', 'accessToken', 'expiresAt', 'cookie']
});
devLog(`Found ${accounts.length} accounts with auto-updates enabled for match results`);
@@ -86,6 +86,7 @@ class AutoFetchMatchResultsService {
account.refreshToken = loginResult.refreshToken;
account.expiresAt = loginResult.expiresAt;
account.cookie = loginResult.cookie;
account.savePassword = true; // ensure flag persists when saving
await account.save();
devLog(`Successfully re-logged in for ${account.email}`);

View File

@@ -20,7 +20,7 @@ class AutoUpdateRatingsService {
autoUpdateRatings: true,
savePassword: true // Must have saved password
},
attributes: ['id', 'userId', 'email', 'encryptedPassword', 'accessToken', 'expiresAt', 'cookie']
attributes: ['id', 'userId', 'email', 'savePassword', 'encryptedPassword', 'accessToken', 'expiresAt', 'cookie']
});
devLog(`Found ${accounts.length} accounts with auto-updates enabled`);
@@ -78,6 +78,7 @@ class AutoUpdateRatingsService {
account.refreshToken = loginResult.refreshToken;
account.expiresAt = loginResult.expiresAt;
account.cookie = loginResult.cookie;
account.savePassword = true; // Ensure flag persists when saving limited attributes
await account.save();
devLog(`Successfully re-logged in for ${account.email}`);