fix(expense): fix issue where timesheet id is not updated properly when expense changes week on update.
This commit is contained in:
parent
daf35d0e40
commit
aa68b5384b
|
|
@ -57,16 +57,19 @@ export class ExpenseUpdateService {
|
|||
|
||||
if (!timesheet) return { success: false, error: `TIMESHEET_NOT_FOUND` }
|
||||
|
||||
|
||||
|
||||
const data = {
|
||||
...normed_expense.data,
|
||||
bank_code_id: type.data,
|
||||
is_approved: dto.is_approved,
|
||||
timesheet_id: timesheet.id,
|
||||
};
|
||||
|
||||
if (!data) return { success: false, error: `INVALID_EXPENSE` }
|
||||
|
||||
const expense = await this.prisma.expenses.update({
|
||||
where: { id: dto.id, timesheet_id: timesheet.id },
|
||||
where: { id: dto.id },
|
||||
data,
|
||||
select: expense_select,
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user