Update .gitignore to exclude Android/Gradle files and enhance TimeEntryController and TimefixService for better error handling and performance. Refactor frontend components to use AppBrand for consistent branding across views.
This commit is contained in:
@@ -11,7 +11,8 @@ class TimeEntryController {
|
||||
*/
|
||||
async getAllEntries(req, res) {
|
||||
try {
|
||||
const entries = timeEntryService.getAllEntries();
|
||||
const userId = req.user?.userId;
|
||||
const entries = await timeEntryService.getAllEntries(userId);
|
||||
res.json(entries);
|
||||
} catch (error) {
|
||||
console.error('Fehler beim Abrufen der Einträge:', error);
|
||||
@@ -119,7 +120,7 @@ class TimeEntryController {
|
||||
async deleteEntry(req, res) {
|
||||
try {
|
||||
const { id } = req.params;
|
||||
timeEntryService.deleteEntry(id);
|
||||
await timeEntryService.deleteEntry(id);
|
||||
|
||||
res.status(204).send();
|
||||
} catch (error) {
|
||||
@@ -262,4 +263,3 @@ class TimeEntryController {
|
||||
|
||||
// Singleton-Instanz exportieren
|
||||
module.exports = new TimeEntryController();
|
||||
|
||||
|
||||
@@ -34,6 +34,10 @@ class TimefixService {
|
||||
|
||||
// Hole auch die Timefixes für diese Einträge
|
||||
const entryIds = entries.map(e => e.id);
|
||||
if (entryIds.length === 0) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const timefixesForEntries = await sequelize.query(
|
||||
`SELECT worklog_id, fix_type, fix_date_time FROM timefix WHERE worklog_id IN (?)`,
|
||||
{
|
||||
@@ -349,4 +353,3 @@ class TimefixService {
|
||||
}
|
||||
|
||||
module.exports = new TimefixService();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user