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
|
|
@ -13,9 +13,9 @@ post {
|
||||||
body:json {
|
body:json {
|
||||||
{
|
{
|
||||||
"date": "2026-01-03",
|
"date": "2026-01-03",
|
||||||
"cents": 1010,
|
"cents": 101111,
|
||||||
"note": "Gas",
|
"note": "Gas",
|
||||||
"categoryId": "db21acbb-0e3e-4ea1-89e1-3d52e5d72cb4",
|
"categoryId": "db21acbb-0e3e-4ea1-89e1-3d52e5d72cb4",
|
||||||
"marchantId": "b9028a32-1305-4699-8611-d8fd812ebc04"
|
"merchantId": "b9028a32-1305-4699-8611-d8fd812ebc04"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,6 @@ post {
|
||||||
|
|
||||||
body:json {
|
body:json {
|
||||||
{
|
{
|
||||||
"name": "Tag Three"
|
"name": "Joe"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,11 +19,13 @@ export class ExpenseDataService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public async create(expense: CreateExpense): Promise<Expense> {
|
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> {
|
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> {
|
public async delete(id: string): Promise<void> {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue