Skip to content

Commit 4a20329

Browse files
Changes in Ordering microservice
1 parent 28b4ccb commit 4a20329

3 files changed

Lines changed: 13 additions & 6 deletions

File tree

src/Services/Ordering/Ordering.API/Controllers/OrderingController.cs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,26 +58,29 @@ public async Task<IActionResult> GetOrderById(Guid orderId)
5858

5959
// POST api/ordering/orders/create
6060
[HttpPut("orders/create")]
61-
public async Task<int> Post([FromBody]Order order)
61+
public async Task<IActionResult> Post([FromBody]Order order)
6262
{
6363
_orderRepository.Add(order);
64-
return await _orderRepository.UnitOfWork.CommitAsync();
64+
int numChanges = await _orderRepository.UnitOfWork.CommitAsync();
65+
return Ok(numChanges);
6566
}
6667

6768
// PUT api/ordering/orders/xxxOrderGUIDxxxx/update
6869
[HttpPut("orders/{orderId:Guid}/update")]
69-
public async Task<int> UpdateOrder(Guid orderID, [FromBody] Order orderToUpdate)
70+
public async Task<IActionResult> UpdateOrder(Guid orderID, [FromBody] Order orderToUpdate)
7071
{
7172
_orderRepository.Update(orderToUpdate);
72-
return await _orderRepository.UnitOfWork.CommitAsync();
73+
int numChanges = await _orderRepository.UnitOfWork.CommitAsync();
74+
return Ok(numChanges);
7375
}
7476

7577
// DELETE api/ordering/orders/xxxOrderGUIDxxxx
7678
[HttpDelete("orders/{orderId:Guid}/remove")]
77-
public async Task<int> Remove(Guid id)
79+
public async Task<IActionResult> Remove(Guid id)
7880
{
7981
await _orderRepository.Remove(id);
80-
return await _orderRepository.UnitOfWork.CommitAsync();
82+
int numChanges = await _orderRepository.UnitOfWork.CommitAsync();
83+
return Ok(numChanges);
8184
}
8285

8386

src/Services/Ordering/Ordering.API/docker-compose.debug.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ services:
1212
- "80:80"
1313
volumes:
1414
- .:/app
15+
extra_hosts:
16+
- "CESARDLBOOKVHD:10.0.75.1"

src/Services/Ordering/Ordering.API/docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ services:
88
dockerfile: Dockerfile
99
ports:
1010
- "80:80"
11+
extra_hosts:
12+
- "CESARDLBOOKVHD:10.0.75.1"

0 commit comments

Comments
 (0)