Skip to content

Commit

Permalink
fix(Pipeline template/front50): Bug fix 6340 (#1016)
Browse files Browse the repository at this point in the history
* fix(Pipeline template/front50): Fix the bug when tag is passed from the template instead of request param

* fix(Pipeline template/front50): Fix the bug when tag is passed from the template instead of request param

Co-authored-by: Radhakrishna Pemmasani <radha.pemmasani@paysafe.com>
Co-authored-by: Adam Jordens <adam@jordens.org>
Co-authored-by: Matt <6519811+mattgogerly@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
5 people committed Dec 4, 2021
1 parent d172384 commit e6a4399
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ Map<String, List<PipelineTemplate>> listVersions(
void save(
@RequestParam(value = "tag", required = false) String tag,
@RequestBody PipelineTemplate pipelineTemplate) {

if (StringUtils.isEmpty(tag)) {
tag = pipelineTemplate.getTag();
}

if (StringUtils.isNotEmpty(tag)) {
validatePipelineTemplateTag(tag);
}
Expand Down Expand Up @@ -118,6 +123,11 @@ PipelineTemplate update(
@PathVariable String id,
@RequestParam(value = "tag", required = false) String tag,
@RequestBody PipelineTemplate pipelineTemplate) {

if (StringUtils.isEmpty(tag)) {
tag = pipelineTemplate.getTag();
}

boolean nonEmptyTag = StringUtils.isNotEmpty(tag);
if (nonEmptyTag) {
validatePipelineTemplateTag(tag);
Expand Down

0 comments on commit e6a4399

Please sign in to comment.