Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
warehouse-management
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ascend
warehouse-management
Commits
8f6b9676
Commit
8f6b9676
authored
May 11, 2021
by
Alex Pinto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing up bug in update endpoint
parent
e726d4e3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
WarehouseController.java
...nalproject/warehouse/controllers/WarehouseController.java
+5
-2
WarehouseOrderService.java
...inalproject/warehouse/services/WarehouseOrderService.java
+0
-3
No files found.
src/main/java/com/ascendfinalproject/warehouse/controllers/WarehouseController.java
View file @
8f6b9676
...
...
@@ -42,8 +42,11 @@ public class WarehouseController {
@CrossOrigin
@PutMapping
(
value
=
"/orders/{id}"
)
public
Mono
<
WarehouseOrderResponse
>
updateOrder
(
@RequestBody
WarehouseOrderResponse
order
,
@PathVariable
(
value
=
"id"
)
String
id
)
{
return
orderService
.
updateOrder
(
order
,
id
);
public
Mono
<
ResponseEntity
>
updateOrder
(
@RequestBody
WarehouseOrderResponse
order
,
@PathVariable
(
value
=
"id"
)
String
id
)
{
return
orderService
.
updateOrder
(
order
,
id
)
.
map
(
updatedOrder
->
(
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
order
)))
.
cast
(
ResponseEntity
.
class
)
.
defaultIfEmpty
(
ResponseEntity
.
status
(
HttpStatus
.
NOT_FOUND
).
body
(
null
));
}
@CrossOrigin
...
...
src/main/java/com/ascendfinalproject/warehouse/services/WarehouseOrderService.java
View file @
8f6b9676
...
...
@@ -45,9 +45,6 @@ public class WarehouseOrderService {
public
Mono
<
WarehouseOrderResponse
>
updateOrder
(
WarehouseOrderResponse
order
,
String
id
)
{
return
orderRepository
.
findById
(
id
)
.
doOnError
(
error
->
{
throw
new
NotFoundException
(
"Warehouse order of ID: "
+
id
+
" not found"
);
})
.
flatMap
(
existingOrder
->
{
existingOrder
.
setStatus
(
order
.
getStatus
());
existingOrder
.
setModifiedAt
(
new
Date
(
System
.
currentTimeMillis
()));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment