Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ public CorsConfigurationSource corsConfigurationSource() {
CorsConfiguration config = new CorsConfiguration();

config.setAllowCredentials(true);
config.setAllowedOrigins(List.of("http://localhost:3000","http://localhost:3001"));
config.setAllowedOrigins(List.of(
"http://localhost:3000",
"http://localhost:3001",
"https://13.49.203.130",
"http://13.49.203.130"
));;
config.setAllowedMethods(List.of("GET", "POST", "PUT", "DELETE", "OPTIONS"));
config.setAllowedHeaders(List.of("*"));
config.setExposedHeaders(List.of("Authorization"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,15 @@
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.UUID;

@RestController
@RequestMapping("/api/v1/roles")
@AllArgsConstructor
Expand All @@ -29,13 +25,6 @@ public class AssignRoleController {
@Operation(
summary = "Assign roles to a user",
description = "Allows admin to assign one or multiple roles to a specific user by their ID.",
requestBody = @RequestBody(
required = true,
description = "User ID and roles list to assign",
content = @Content(
schema = @Schema(implementation = AssignRoleRequest.class)
)
),
responses = {
@ApiResponse(
responseCode = "200",
Expand All @@ -57,7 +46,7 @@ public class AssignRoleController {
}
)
@PutMapping("/assign")
public ResponseEntity<?> assignRole(@Valid @RequestBody AssignRoleRequest request) {
public ResponseEntity<?> assignRole(@RequestBody AssignRoleRequest request) {
String result = assignRoleUseCase.execute(new AssignRoleCommand(request.id(), request.roleIds()));

return ResponseEntity.ok(StandardSuccessResponse.<String>builder()
Expand Down