Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create EndorsementController #41

Merged
merged 35 commits into from
Dec 31, 2023
Merged
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
0fdea86
create EndorsementController
bhtibrewal Nov 23, 2023
9a89d07
add env to ignore
bhtibrewal Nov 23, 2023
0d0aa10
add DTO and DROs
bhtibrewal Nov 24, 2023
3175cc6
de.env
bhtibrewal Nov 25, 2023
c9af284
merge branch update_model
bhtibrewal Nov 25, 2023
e90b5f2
create EndorsementListController
bhtibrewal Nov 25, 2023
d1faad5
remove EndorsementListController
bhtibrewal Nov 26, 2023
c0e211e
add EndorsementServiceTest.java
bhtibrewal Nov 26, 2023
39cf6f9
Merge branch 'develop' into postEndorsementAPI
bhtibrewal Nov 26, 2023
1f6c2d4
add JsonManagedReference
bhtibrewal Dec 1, 2023
ca1b171
Merge remote-tracking branch 'origin/postEndorsementAPI' into postEnd…
bhtibrewal Dec 1, 2023
0fde179
address some review comments
bhtibrewal Dec 4, 2023
a8a2e5e
added validation checks
bhtibrewal Dec 5, 2023
e867d0f
remove extra entries in EndorsementDRO.java
bhtibrewal Dec 6, 2023
be11ae5
handle NoEntityException
bhtibrewal Dec 6, 2023
2b17be2
add DB_NAME variable in application.properties
bhtibrewal Dec 6, 2023
3cacabe
handle exceptions in one catch block
bhtibrewal Dec 6, 2023
2e8bbe0
made ApiResponse class
bhtibrewal Dec 6, 2023
2084c09
handle NoEntityException exception globally
bhtibrewal Dec 6, 2023
d89effd
remove default false
bhtibrewal Dec 7, 2023
ba72dd8
Merge branch 'develop' of https://github.com/Real-Dev-Squad/skill-tre…
bhtibrewal Dec 29, 2023
08bf445
merge the tests
bhtibrewal Dec 29, 2023
77f7110
delete usused files
bhtibrewal Dec 29, 2023
5742947
fix build, add missing imports
bhtibrewal Dec 29, 2023
c5a09ca
fix EndorsementListServiceTest
bhtibrewal Dec 30, 2023
f4cbbbd
fix testCreateEndorsement test
bhtibrewal Dec 30, 2023
05237e6
revert change
bhtibrewal Dec 30, 2023
717f24d
add integration test
bhtibrewal Dec 30, 2023
eae68d5
update integration test
bhtibrewal Dec 30, 2023
9ed6eb3
update integration test
bhtibrewal Dec 30, 2023
f3f9894
revert integration test
bhtibrewal Dec 30, 2023
bb7ae49
fix integration test
bhtibrewal Dec 31, 2023
2fab76d
use GenericResponse
bhtibrewal Dec 31, 2023
3acd3d5
fix return type
bhtibrewal Dec 31, 2023
d90443f
change endorsementModel to EndorsementDTO.toDto
bhtibrewal Dec 31, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ public ResponseEntity<GenericResponse<EndorsementDTO>> getEndorsementById(@PathV
}

@PostMapping(value="")
public ResponseEntity<?> postEndorsement(@RequestBody @Valid EndorsementDRO endorsementDRO) {
public ResponseEntity<GenericResponse<EndorsementModel>> postEndorsement(@RequestBody @Valid EndorsementDRO endorsementDRO) {
vikhyat187 marked this conversation as resolved.
Show resolved Hide resolved

EndorsementModel endorsementModel = endorsementService.createEndorsement(endorsementDRO);
if (endorsementModel != null)
return new ResponseEntity<>(new GenericResponse<EndorsementModel>(endorsementModel, ""), HttpStatus.CREATED);
return new ResponseEntity<>(new GenericResponse<EndorsementDTO>(null,"Failed to create endorsement"), HttpStatus.BAD_REQUEST);
return new ResponseEntity<>(new GenericResponse<EndorsementModel>(null,"Failed to create endorsement"), HttpStatus.BAD_REQUEST);

}
}