fixed PUT nullable merchant/note

This commit is contained in:
Joe Arndt 2026-02-25 14:49:49 -06:00
parent 389ef8c7ce
commit f390e2a8c3
7 changed files with 74 additions and 52 deletions

View file

@ -58,15 +58,16 @@ export class ExpensesController {
}
}
// @Put()
// @HttpCode(HttpStatus.OK)
// public async update(@Body() expense: UpdateExpenseDto): Promise<GetExpenseDto> {
// if (!expense.id) {
// throw new BadRequestException('Expense ID cannot be empty.');
// }
//
// return await this.expensesService.update(expense);
// }
@Put()
@HttpCode(HttpStatus.OK)
public async update(@Body() expense: UpdateExpenseDto): Promise<GetExpenseDto> {
if (!expense.id) {
throw new BadRequestException('Expense ID cannot be empty.');
}
// TODO: Validate date/cents/category exist...
return await this.expensesService.update(expense);
}
@Delete(':id')
@HttpCode(HttpStatus.NO_CONTENT)