fix generate excel in admin account

This commit is contained in:
richardtekula
2025-11-25 09:27:11 +01:00
parent 31297ee9a9
commit 043eeccb77
5 changed files with 22 additions and 13 deletions

View File

@@ -208,11 +208,13 @@ export const getTimeEntryWithRelations = async (req, res) => {
*/
export const updateTimeEntry = async (req, res) => {
try {
const userId = req.userId;
const { entryId } = req.params;
const { startTime, endTime, projectId, todoId, companyId, description } = req.body;
const entry = await timeTrackingService.updateTimeEntry(entryId, userId, {
const entry = await timeTrackingService.updateTimeEntry(entryId, {
userId: req.userId,
role: req.user.role,
}, {
startTime,
endTime,
projectId,
@@ -238,10 +240,12 @@ export const updateTimeEntry = async (req, res) => {
*/
export const deleteTimeEntry = async (req, res) => {
try {
const userId = req.userId;
const { entryId } = req.params;
const result = await timeTrackingService.deleteTimeEntry(entryId, userId);
const result = await timeTrackingService.deleteTimeEntry(entryId, {
userId: req.userId,
role: req.user.role,
});
res.status(200).json(result);
} catch (error) {