corrected updating expense to return all data)

This commit is contained in:
Joe Arndt 2026-02-22 23:15:12 -06:00
parent ee823d015b
commit 2185aa5415
3 changed files with 7 additions and 5 deletions

View file

@ -19,11 +19,13 @@ export class ExpenseDataService {
}
public async create(expense: CreateExpense): Promise<Expense> {
return await this.expenses.save(expense);
const created = await this.expenses.save(expense);
return await this.expenses.findOneBy({ id: created.id }) as Expense;
}
public async update(expense: UpdateExpense): Promise<Expense> {
return await this.expenses.save(expense);
await this.expenses.save(expense);
return await this.expenses.findOneBy({ id: expense.id }) as Expense;
}
public async delete(id: string): Promise<void> {