Commit f804afa2 authored by Aksel Baardsen's avatar Aksel Baardsen
Browse files

logical error allowing for duplicate species fixed

parent 52c14a22
...@@ -58,7 +58,7 @@ func GetCountryByCode(code, limit string) (Country, int) { ...@@ -58,7 +58,7 @@ func GetCountryByCode(code, limit string) (Country, int) {
// and checks if the country-code is correct // and checks if the country-code is correct
if country.Code == species.Results[i].CountryCode { if country.Code == species.Results[i].CountryCode {
// and checks that the species is unique // and checks that the species is unique
if species.Results[i].SpeciesKey != 0 || contains(country.SpeciesKey, species.Results[i].SpeciesKey) { if species.Results[i].SpeciesKey != 0 && contains(country.SpeciesKey, species.Results[i].SpeciesKey) {
country.Species = append(country.Species, species.Results[i].Species) country.Species = append(country.Species, species.Results[i].Species)
country.SpeciesKey = append(country.SpeciesKey, species.Results[i].SpeciesKey) country.SpeciesKey = append(country.SpeciesKey, species.Results[i].SpeciesKey)
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment