Retain badge order from the Discord API
All checks were successful
Deploy API / deploy (ubuntu-latest, 2.44.0) (push) Successful in 1m1s

This commit is contained in:
Braydon 2024-09-10 17:02:28 -04:00
parent e90b672918
commit 113f160080

@ -5,7 +5,7 @@ import kong.unirest.core.json.JSONObject;
import lombok.*; import lombok.*;
import me.braydon.tether.model.user.DiscordUser; import me.braydon.tether.model.user.DiscordUser;
import java.util.HashSet; import java.util.LinkedHashSet;
import java.util.Set; import java.util.Set;
/** /**
@ -43,7 +43,7 @@ public class UserBadge {
*/ */
@NonNull @NonNull
public static Set<UserBadge> fromJson(@NonNull JSONObject userJson) { public static Set<UserBadge> fromJson(@NonNull JSONObject userJson) {
Set<UserBadge> badges = new HashSet<>(); Set<UserBadge> badges = new LinkedHashSet<>();
if (!userJson.has("badges")) { if (!userJson.has("badges")) {
return badges; return badges;
} }