From 2e4c4a544368fd5629568faffd1f4131eb08359b Mon Sep 17 00:00:00 2001 From: muralibasani Date: Fri, 24 Nov 2023 11:37:55 +0100 Subject: [PATCH] Update cache on db update Signed-off-by: muralibasani --- .../java/io/aiven/klaw/model/requests/ProfileModel.java | 2 +- .../aiven/klaw/model/requests/RegisterUserInfoModel.java | 2 +- .../io/aiven/klaw/service/UsersTeamsControllerService.java | 7 ++++++- openapi.yaml | 4 ++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/io/aiven/klaw/model/requests/ProfileModel.java b/core/src/main/java/io/aiven/klaw/model/requests/ProfileModel.java index b7a5e28c84..84242cf163 100644 --- a/core/src/main/java/io/aiven/klaw/model/requests/ProfileModel.java +++ b/core/src/main/java/io/aiven/klaw/model/requests/ProfileModel.java @@ -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. diff --git a/core/src/main/java/io/aiven/klaw/model/requests/RegisterUserInfoModel.java b/core/src/main/java/io/aiven/klaw/model/requests/RegisterUserInfoModel.java index 64ee7bdb6e..076137080d 100644 --- a/core/src/main/java/io/aiven/klaw/model/requests/RegisterUserInfoModel.java +++ b/core/src/main/java/io/aiven/klaw/model/requests/RegisterUserInfoModel.java @@ -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.", diff --git a/core/src/main/java/io/aiven/klaw/service/UsersTeamsControllerService.java b/core/src/main/java/io/aiven/klaw/service/UsersTeamsControllerService.java index 2326b718bf..6d72e347da 100644 --- a/core/src/main/java/io/aiven/klaw/service/UsersTeamsControllerService.java +++ b/core/src/main/java/io/aiven/klaw/service/UsersTeamsControllerService.java @@ -148,7 +148,7 @@ 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()); @@ -156,6 +156,11 @@ public ApiResponse updateProfile(ProfileModel profileModel) throws KlawException 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); diff --git a/openapi.yaml b/openapi.yaml index e5b3d3e3fc..504e5f5815 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -8126,13 +8126,13 @@ }, "Scales" : { "properties" : { - "yaxes" : { + "xaxes" : { "type" : "array", "items" : { "$ref" : "#/components/schemas/YAx" } }, - "xaxes" : { + "yaxes" : { "type" : "array", "items" : { "$ref" : "#/components/schemas/YAx"