Skip to content

Commit

Permalink
Update cache on db update
Browse files Browse the repository at this point in the history
Signed-off-by: muralibasani <[email protected]>
  • Loading branch information
muralibasani committed Nov 24, 2023
1 parent 8280f37 commit 2e4c4a5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
public class ProfileModel implements Serializable {

@NotNull(message = "Fullname cannot be null")
@Size(min = 5, max = 50, message = "Name must be above 4 characters")
@Size(min = 5, max = 50, message = "Name must be atleast 5 characters")
@Pattern(
message = "Invalid Full name",
regexp = "^[A-Za-zÀ-ÖØ-öø-ÿ' ]*$") // Pattern a-zA-z accents and umlaut and/or spaces.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class RegisterUserInfoModel implements Serializable {

private String role;

@Size(min = 5, max = 50, message = "Name must be above 4 characters")
@Size(min = 5, max = 50, message = "Name must be atleast 5 characters")
@NotNull(message = "Name cannot be null")
@Pattern(
message = "Invalid Full name.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,19 @@ private void updateSwitchTeamsList(
}

public ApiResponse updateProfile(ProfileModel profileModel) throws KlawException {
log.info("updateProfile {}", profileModel);
log.debug("updateProfile {}", profileModel);
HandleDbRequests dbHandle = manageDatabase.getHandleDbRequests();

UserInfo userInfo = dbHandle.getUsersInfo(getUserName());
userInfo.setFullname(profileModel.getFullname());
userInfo.setMailid(profileModel.getMailid());
try {
String result = dbHandle.updateUser(userInfo);
commonUtilsService.updateMetadata(
commonUtilsService.getTenantId(getUserName()),
EntityType.USERS,
MetadataOperationType.UPDATE,
userInfo.getUsername());
return ApiResultStatus.SUCCESS.value.equals(result)
? ApiResponse.ok(result)
: ApiResponse.notOk(result);
Expand Down
4 changes: 2 additions & 2 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8126,13 +8126,13 @@
},
"Scales" : {
"properties" : {
"yaxes" : {
"xaxes" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/YAx"
}
},
"xaxes" : {
"yaxes" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/YAx"
Expand Down

0 comments on commit 2e4c4a5

Please sign in to comment.