Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
inventory-service
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
0
Merge Requests
0
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
inventory-service
Commits
d321aeed
Commit
d321aeed
authored
May 06, 2021
by
Khai Yuan Liew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[AFP-57] Work on PUT product endpoint
parent
66d5f1fc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
5 deletions
+1
-5
ProductController.java
.../nisum/ascend/inventory/controller/ProductController.java
+1
-4
ProductService.java
...va/com/nisum/ascend/inventory/service/ProductService.java
+0
-1
No files found.
src/main/java/com/nisum/ascend/inventory/controller/ProductController.java
View file @
d321aeed
...
...
@@ -41,16 +41,13 @@ public class ProductController {
return
ResponseEntity
.
ok
(
productService
.
findAllProducts
());
}
// @PutMapping("/{
userId
}")
// @PutMapping("/{
sku
}")
// public Mono<ResponseEntity<Product>> updateProduct(@PathVariable String sku, @RequestBody Product product){
// return productService.updateProductBySku(sku,user)
// .map(updatedProduct -> ResponseEntity.ok(updatedProduct))
// .defaultIfEmpty(ResponseEntity.badRequest().build());
// }
}
@PostMapping
(
""
)
public
Mono
<
ProductDto
>
postProduct
(
@RequestBody
Product
product
)
{
return
productService
.
createProduct
(
product
).
onErrorMap
(
throwable
->
new
ResourceAlreadyExistsException
());
...
...
src/main/java/com/nisum/ascend/inventory/service/ProductService.java
View file @
d321aeed
...
...
@@ -51,7 +51,6 @@ public class ProductService {
});
}
public
Mono
<
ProductDto
>
createProduct
(
Product
product
)
{
return
productRepository
.
save
(
product
)
.
map
(
ProductDto:
:
generateDtoFromProduct
);
...
...
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