Skip to content

BackEnd_OS-151 Add several methods in Discussion Questions and Answers#189

Open
gariktepanosian wants to merge 5 commits intomainfrom
backend_OS-151
Open

BackEnd_OS-151 Add several methods in Discussion Questions and Answers#189
gariktepanosian wants to merge 5 commits intomainfrom
backend_OS-151

Conversation

@gariktepanosian
Copy link
Collaborator

…or AND create the Mentor answer and add the several methods in Peers answer

ADD the peers and mentor to answer the controller some requests AND write the unit test

…or AND create the Mentor answer and add the several methods in Peers answer

ADD the peers and mentor answer controller some requests AND write te unit test
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug C 42 Bugs
Vulnerability C 3 Vulnerabilities
Security Hotspot E 6 Security Hotspots
Code Smell A 141 Code Smells

49.7% 49.7% Coverage
1.4% 1.4% Duplication

answerId, questionId, enrolledCourseId, currentUserEmail)
.orElseThrow(IllegalArgumentException::new);
mentorAnswer.setText(request.getText());
mentorAnswer.setCreatedDate(Instant.now());
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's create a new field updated date, not to mix with created date.

answerId, questionId, enrolledCourseId, currentUserEmail)
.orElseThrow(IllegalArgumentException::new);
peersAnswer.setText(request.getText());
peersAnswer.setCreatedDate(Instant.now());
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same updatedAt field as well

description = "Invalid request arguments provided.",
content = @Content(schema = @Schema(implementation = ResponseMessage.class)))
})
@PutMapping("/{enrolledCourseId}/peers-questions/answers/{questionId}/{answerId}")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the url should be answers/{answerId}

description = "Invalid request arguments provided.",
content = @Content(schema = @Schema(implementation = ResponseMessage.class)))
})
@DeleteMapping("/{enrolledCourseId}/peers-questions/answers/{questionId}/{answerId}")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same here

@@ -38,17 +39,19 @@
public class DiscussionForumController {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't it possible to delete and update answers using only question and answer ids ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants