Skip to content

Adding the ability to rename sites#270

Merged
cody-constine-ttd merged 3 commits intomainfrom
cbc-UID2-2181-add-rename-sites
May 6, 2024
Merged

Adding the ability to rename sites#270
cody-constine-ttd merged 3 commits intomainfrom
cbc-UID2-2181-add-rename-sites

Conversation

@cody-constine-ttd
Copy link
Contributor

@cody-constine-ttd cody-constine-ttd commented Apr 25, 2024

Before Rename:
image
After Rename:
image

}
}
if (name != null) {
if (validateSiteName(rc, name)) return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears the convention in this file (which I also prefer) is that if statements have a following brace:
if (validateSitenName(rc, name)) {
return;
}

.stream().filter(c -> c.getName().equals(name))
.findFirst();
if (existingSite.isPresent()) {
ResponseUtil.error(rc, 400, "site existed");
Copy link
Contributor

@alex-yau-ttd alex-yau-ttd May 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: not that the code is new, but could we possibly align on some improved language and do something like we do in ServiceService.java

So:

ResponseUtil.error(rc, 400, "site with name" + name + " already exists");

};
setSites(sites);

post(vertx, testContext, "api/site/update?id=11&name=site2", null, response -> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think extracting this case to a separate test renameSiteTestDuplicateName would help with readability

@cody-constine-ttd cody-constine-ttd merged commit f62e552 into main May 6, 2024
@cody-constine-ttd cody-constine-ttd deleted the cbc-UID2-2181-add-rename-sites branch May 6, 2024 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants