Code quality improvements from code review
- Add admin-only authorization for company and projects CRUD operations - Create requireAccountId middleware to eliminate code duplication - Standardize error handling (use next(error) consistently) - Change error messages to Slovak language 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -24,7 +24,7 @@ export const getAllNotes = async (req, res, next) => {
|
||||
data: notes,
|
||||
});
|
||||
} catch (error) {
|
||||
return next(error);
|
||||
next(error);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -43,7 +43,7 @@ export const getNoteById = async (req, res, next) => {
|
||||
data: note,
|
||||
});
|
||||
} catch (error) {
|
||||
return next(error);
|
||||
next(error);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -65,7 +65,7 @@ export const createNote = async (req, res, next) => {
|
||||
message: 'Poznámka bola vytvorená',
|
||||
});
|
||||
} catch (error) {
|
||||
return next(error);
|
||||
next(error);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -87,7 +87,7 @@ export const updateNote = async (req, res, next) => {
|
||||
message: 'Poznámka bola aktualizovaná',
|
||||
});
|
||||
} catch (error) {
|
||||
return next(error);
|
||||
next(error);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -106,7 +106,7 @@ export const deleteNote = async (req, res, next) => {
|
||||
message: result.message,
|
||||
});
|
||||
} catch (error) {
|
||||
return next(error);
|
||||
next(error);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -126,7 +126,7 @@ export const getMyReminders = async (req, res, next) => {
|
||||
data: reminders,
|
||||
});
|
||||
} catch (error) {
|
||||
return next(error);
|
||||
next(error);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -146,6 +146,6 @@ export const markReminderSent = async (req, res, next) => {
|
||||
message: 'Reminder označený ako odoslaný',
|
||||
});
|
||||
} catch (error) {
|
||||
return next(error);
|
||||
next(error);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user