File tree 3 files changed +13
-11
lines changed
java/com/parallax/server/blocklyprop
resources/com/parallax/server/blocklyprop/internationalization
3 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -148,14 +148,14 @@ public Response get(
148
148
149
149
// Sort flag evaluation
150
150
if (!restProjectUtils .ValidateSortType (sort )) {
151
- LOG .warn ("{} Sort parameter failed" , endPoint );
152
- return Response . status ( Response . Status . NOT_ACCEPTABLE ). build () ;
151
+ LOG .warn ("{} Sort parameter failed. Defaulting to sort by project name " , endPoint );
152
+ sort = TableSort . name ;
153
153
}
154
154
155
155
// Sort order evaluation
156
156
if (!restProjectUtils .ValidateSortOrder (order )) {
157
- LOG .warn ("{} Sort order parameter failed" , endPoint );
158
- return Response . status ( Response . Status . NOT_ACCEPTABLE ). build () ;
157
+ LOG .warn ("{} Sort order parameter failed. Defaulting to ascending order " , endPoint );
158
+ order = TableOrder . asc ;
159
159
}
160
160
161
161
// Limit result set value
Original file line number Diff line number Diff line change 27
27
public class RestProjectUtils {
28
28
29
29
30
+ /**
31
+ *
32
+ * @param sort
33
+ * @return
34
+ * Return true if the provided sort is a valid item, otherwise return false
35
+ */
30
36
public boolean ValidateSortType (TableSort sort ) {
31
37
32
- boolean parametersValid = false ;
33
-
34
38
if (sort != null ) {
35
39
for (TableSort t : TableSort .values ()) {
36
-
37
40
if (sort == t ) {
38
- parametersValid = true ;
39
- break ;
41
+ return true ;
40
42
}
41
43
}
42
44
}
43
45
44
- return parametersValid ;
46
+ return false ;
45
47
}
46
48
47
49
public boolean ValidateSortOrder (TableOrder order ) {
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ footer.clientdownloadlink = BlocklyProp-client
28
28
# Application version numbers.
29
29
application.major = 1
30
30
application.minor = 1
31
- application.build = 451
31
+ application.build = 452
32
32
33
33
html.content_missing = Content missing
34
34
You can’t perform that action at this time.
0 commit comments