Skip to content

Commit 703afa1

Browse files
committed
fix: requestparam optional
1 parent 9d0d566 commit 703afa1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

app/src/main/java/com/growit/app/goal/controller/GoalController.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ public class GoalController {
3838

3939
@GetMapping
4040
public ResponseEntity<ApiResponse<List<Goal>>> getMyGoal(
41-
@AuthenticationPrincipal User user, @RequestParam(required = false) GoalStatus status) {
42-
status = status == null ? GoalStatus.NONE : status;
43-
List<Goal> goals = getUserGoalsUseCase.getMyGoals(user, status);
41+
@AuthenticationPrincipal User user, @RequestParam(required = false) String status) {
42+
GoalStatus goalStatus;
43+
goalStatus = status == null ? GoalStatus.NONE : GoalStatus.valueOf(status);
44+
List<Goal> goals = getUserGoalsUseCase.getMyGoals(user, goalStatus);
4445
return ResponseEntity.ok(ApiResponse.success(goals));
4546
}
4647

0 commit comments

Comments
 (0)