Skip to content

Commit 151fcd0

Browse files
authored
chore : 문제 검색 api 경로 변경 (#131)
1 parent 4caaf35 commit 151fcd0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/main/java/org/ezcode/codetest/presentation/problemmanagement/ProblemSearchController.java renamed to src/main/java/org/ezcode/codetest/presentation/problemmanagement/problem/ProblemSearchController.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.ezcode.codetest.presentation.problemmanagement;
1+
package org.ezcode.codetest.presentation.problemmanagement.problem;
22

33
import java.util.List;
44
import java.util.Set;
@@ -22,7 +22,7 @@
2222
@RestController
2323
@Validated
2424
@RequiredArgsConstructor
25-
@RequestMapping("/problems/search")
25+
@RequestMapping("/api/problems")
2626
public class ProblemSearchController {
2727

2828
private final ProblemSearchService searchService;
@@ -51,7 +51,7 @@ public ResponseEntity<Set<String>> getProblemSuggestions(
5151
@ApiResponse(responseCode = "200", description = "해당 검색어에 매칭되는 대한 문제 반환")
5252
}
5353
)
54-
@GetMapping
54+
@GetMapping("/search")
5555
public ResponseEntity<List<ProblemSearchResponse>> getProblemSearchResult(
5656
@RequestParam
5757
@NotBlank(message = "검색어를 입력하세요.")

src/main/resources/templates/search-page.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
const token = getToken();
134134
if (!keyword || !token) return;
135135
try {
136-
const resp = await fetch('/problems/search/suggestions?keyword=' + encodeURIComponent(keyword), {
136+
const resp = await fetch('/api/problems/suggestions?keyword=' + encodeURIComponent(keyword), {
137137
headers: { 'Authorization': 'Bearer ' + token }
138138
});
139139
if (!resp.ok) throw new Error();
@@ -205,7 +205,7 @@
205205
await new Promise(r => setTimeout(r, 1000));
206206

207207
try {
208-
const resp = await fetch('/problems/search?keyword=' + encodeURIComponent(kw), {
208+
const resp = await fetch('/api/problems/search?keyword=' + encodeURIComponent(kw), {
209209
method: 'GET',
210210
headers: { 'Authorization': 'Bearer ' + token }
211211
});

0 commit comments

Comments
 (0)