AtlasOfLivingAustralia/specieslist-webapp

Use Token in list deletion and use the default value when a max param is not properly given

Opened this issue · 1 comments

1,List deletion still send API Key to delete the related record in Collection service

2, http://lists.ala.org.au/public/speciesLists?isThreatened=eq%3Atrue%27&max=25%27&order=asc%27&q=%27&sort=itemsCount%27

Generated

groovy.lang.MissingMethodException: No signature of method: static java.lang.Math.min() is applicable for argument types: (null, Integer) values: [null, 1000]
Possible solutions: min(int, int), min(double, double), min(float, float), min(long, long), find(), max(int, int)

This error was introduced since the value of max passed max=25%27 in was not an integer

Fix:
If parsing Max fails, then use the default 25 as max

Test:

by given a wrong value toparam: max, e.g. max = testinto
https://lists-test.ala.org.au/public/speciesLists?isThreatened=eq%3Atrue%27&max=test&order=asc%27&q=&sort=itemsCount

It should return the list which max is set to the default value 25