corrected updating expense to return all data)
This commit is contained in:
parent
ee823d015b
commit
2185aa5415
3 changed files with 7 additions and 5 deletions
|
|
@ -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> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue