Skip to content

Commit 1a6c884

Browse files
committed
move expression
1 parent 1a46519 commit 1a6c884

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

constructorio-client/src/main/java/io/constructor/client/ConstructorIO.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1795,13 +1795,6 @@ public RecommendationsResponse recommendations(RecommendationsRequest req, UserI
17951795
*/
17961796
public String recommendationsAsJSON(RecommendationsRequest req, UserInfo userInfo)
17971797
throws ConstructorException {
1798-
if (StringUtils.isNotBlank(req.getVariationId())) {
1799-
if (req.getItemIds() == null || req.getItemIds().size() != 1) {
1800-
throw new ConstructorException(
1801-
"variationId requires exactly one itemId to be specified");
1802-
}
1803-
}
1804-
18051798
try {
18061799
List<String> paths = Arrays.asList("recommendations", "v1", "pods", req.getPodId());
18071800
HttpUrl url = (userInfo == null) ? this.makeUrl(paths) : this.makeUrl(paths, userInfo);
@@ -1819,6 +1812,10 @@ public String recommendationsAsJSON(RecommendationsRequest req, UserInfo userInf
18191812
}
18201813

18211814
if (StringUtils.isNotBlank(req.getVariationId())) {
1815+
if (req.getItemIds() == null || req.getItemIds().size() != 1) {
1816+
throw new IllegalArgumentException(
1817+
"variationId requires exactly one itemId to be specified");
1818+
}
18221819
url =
18231820
url.newBuilder()
18241821
.addQueryParameter("variation_id", req.getVariationId())

0 commit comments

Comments
 (0)