Skip to content

Commit

Permalink
Merge pull request #3062 from HenrikJannsen/fix-getSelectedUserProfil…
Browse files Browse the repository at this point in the history
…e-api

Fix getSelectedUserProfile api
  • Loading branch information
HenrikJannsen authored Dec 23, 2024
2 parents ee0f393 + 88589d8 commit e49176b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public static void config() {
DistributedDataResolver.addResolver("bonded_roles.AuthorizedBondedRole", AuthorizedBondedRole.getResolver());
DistributedDataResolver.addResolver("bonded_roles.AuthorizedAlertData", AuthorizedAlertData.getResolver());
DistributedDataResolver.addResolver("bonded_roles.AuthorizedDifficultyAdjustmentData", AuthorizedDifficultyAdjustmentData.getResolver());
//noinspection deprecation
DistributedDataResolver.addResolver("bonded_roles.AuthorizedMinRequiredReputationScoreData", AuthorizedMinRequiredReputationScoreData.getResolver());
DistributedDataResolver.addResolver("bonded_roles.ReleaseNotification", ReleaseNotification.getResolver());
DistributedDataResolver.addResolver("bonded_roles.AuthorizedMarketPriceData", AuthorizedMarketPriceData.getResolver());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
import bisq.dto.DtoMappings;
import bisq.dto.security.keys.KeyPairDto;
import bisq.dto.security.pow.ProofOfWorkDto;
import bisq.dto.user.profile.UserProfileDto;
import bisq.http_api.rest_api.domain.RestApiBase;
import bisq.security.DigestUtil;
import bisq.security.SecurityService;
import bisq.security.pow.ProofOfWork;
import bisq.user.identity.NymIdGenerator;
import bisq.user.identity.UserIdentity;
import bisq.user.identity.UserIdentityService;
import bisq.user.profile.UserProfile;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
Expand All @@ -44,7 +44,6 @@

import java.security.KeyPair;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -147,8 +146,8 @@ public void createUserIdentity(CreateUserIdentityRequest request,
}
}


@GET
// Create UserIdentityDto
/* @GET
@Path("/{id}")
@Operation(
summary = "Get User Identity",
Expand All @@ -166,7 +165,7 @@ public Response getUserIdentity(@PathParam("id") String id) {
return buildNotFoundResponse("Could not find user identity for ID: " + id);
}
return buildOkResponse(userIdentity.get());
}
}*/

@GET
@Path("/ids")
Expand All @@ -188,13 +187,13 @@ public Response getUserIdentityIds() {
}

@GET
@Path("/selected")
@Path("/selected/user-profile")
@Operation(
summary = "Get Selected User Profile",
description = "Retrieves the selected user profile.",
responses = {
@ApiResponse(responseCode = "200", description = "Selected user profile retrieved successfully",
content = @Content(schema = @Schema(implementation = UserProfile.class))),
content = @Content(schema = @Schema(implementation = UserProfileDto.class))),
@ApiResponse(responseCode = "404", description = "No selected user identity found"),
@ApiResponse(responseCode = "500", description = "Internal server error")
}
Expand All @@ -204,7 +203,7 @@ public Response getSelectedUserProfile() {
if (selectedUserIdentity == null) {
return buildNotFoundResponse("No selected user identity found.");
}
UserProfile userProfile = selectedUserIdentity.getUserProfile();
return buildOkResponse(userProfile);
UserProfileDto userProfileDto = DtoMappings.UserProfileDtoMapping.from(selectedUserIdentity.getUserProfile());
return buildOkResponse(userProfileDto);
}
}

0 comments on commit e49176b

Please sign in to comment.