Skip to content

Commit

Permalink
optimize: pre check dataChangeCreatedBy in updateItem
Browse files Browse the repository at this point in the history
  • Loading branch information
k8scat authored and nobodyiam committed Jan 18, 2025
1 parent 34a2c11 commit 8acf075
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ public void updateItem(@PathVariable String appId, @PathVariable String env,
}

if (createIfNotExists) {
if (StringUtils.isEmpty(item.getDataChangeCreatedBy())) {
throw new BadRequestException("dataChangeCreatedBy is required when createIfNotExists is true");
}
this.itemOpenApiService.createOrUpdateItem(appId, env, clusterName, namespaceName, item);
} else {
this.itemOpenApiService.updateItem(appId, env, clusterName, namespaceName, item);
Expand Down

0 comments on commit 8acf075

Please sign in to comment.