AtlasOfLivingAustralia / specieslist-webapp

Species lists and traits tool
https://lists.ala.org.au
Mozilla Public License 2.0
6 stars 21 forks source link

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

Open qifeng-bai opened 1 year ago

qifeng-bai commented 1 year ago

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

qifeng-bai commented 1 year ago

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