Skip to content

Commit

Permalink
refactor(member): return 201 created when profile image was uploaded
Browse files Browse the repository at this point in the history
  • Loading branch information
junghoon-vans committed Apr 4, 2023
1 parent 2985a28 commit 4930504
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.dnd.weddingmap.global.util.MessageUtil;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.DeleteMapping;
Expand Down Expand Up @@ -96,9 +97,11 @@ public ResponseEntity<SuccessResponse> postProfileImage(
}
memberService.putProfileImage(user.getId(), imageUrl);

return ResponseEntity.ok(SuccessResponse.builder()
.data(new ProfileImageDto(imageUrl))
.build());
return ResponseEntity.status(HttpStatus.CREATED).body(
SuccessResponse.builder()
.httpStatus(HttpStatus.CREATED)
.data(new ProfileImageDto(imageUrl))
.build());
}

@DeleteMapping
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ void postProfile() throws Exception {
);

// then
result.andExpect(status().isOk())
result.andExpect(status().isCreated())
.andDo(document("member/put-profile",
requestHeaders(
headerWithName(HttpHeaders.AUTHORIZATION).description("액세스 토큰")
Expand Down

0 comments on commit 4930504

Please sign in to comment.