Freshers-qa
This commit is contained in:
@@ -31,19 +31,6 @@ public class CommunityQuestionController {
|
||||
return questionRepository.findAll();
|
||||
}
|
||||
|
||||
@GetMapping("/paged")
|
||||
public org.springframework.data.domain.Page<CommunityQuestion> getPagedQuestions(
|
||||
@RequestParam(defaultValue = "0") int page,
|
||||
@RequestParam(defaultValue = "5") int size) {
|
||||
return questionRepository.findAll(
|
||||
org.springframework.data.domain.PageRequest.of(
|
||||
page,
|
||||
size,
|
||||
org.springframework.data.domain.Sort.by("createdAt").descending()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public CommunityQuestion createQuestion(@RequestBody CommunityQuestion question) {
|
||||
if (question.getUpvotes() == null) question.setUpvotes(0);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# ─── DATABASE CONNECTION CONFIGURATION ───
|
||||
spring.datasource.url=jdbc:postgresql://localhost:5432/rit_freshers_hub?sslmode=disable
|
||||
spring.datasource.url=jdbc:postgresql://localhost:5433/rit_freshers_hub?sslmode=disable
|
||||
spring.datasource.username=postgres
|
||||
spring.datasource.password=${DB_PASSWORD:Anbukathir@#$2006}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user