diff --git a/database/src/main/java/com/alttd/altitudeweb/database/litebans/NameHistoryMapper.java b/database/src/main/java/com/alttd/altitudeweb/database/litebans/NameHistoryMapper.java index 8e3f471..ef2197f 100644 --- a/database/src/main/java/com/alttd/altitudeweb/database/litebans/NameHistoryMapper.java +++ b/database/src/main/java/com/alttd/altitudeweb/database/litebans/NameHistoryMapper.java @@ -137,20 +137,21 @@ public interface NameHistoryMapper { @Select(""" SELECT punishment.uuid, user_lookup.name AS punished_name, - reason, - banned_by_uuid, - banned_by_name, - removed_by_name, - time, - until, - removed_by_reason - FROM ${tableName} AS punishment - INNER JOIN user_lookup ON user_lookup.uuid = punishment.uuid + punishment.reason, + punishment.banned_by_uuid, + punishment.banned_by_name, + punishment.removed_by_name, + punishment.time, + punishment.until, + punishment.removed_by_reason + FROM ${table_name} AS punishment + INNER JOIN user_lookup + ON user_lookup.uuid = punishment.uuid WHERE ${name_column} LIKE #{partialName} ORDER BY time DESC LIMIT #{limit} OFFSET #{offset} """) - List getRecentHistoryForName(@Param("tableName") String tableName, + List getRecentHistoryForName(@Param("table_name") String tableName, @Param("partialName") String partialName, @Param("name_column") String nameColumn, @Param("limit") int limit, @@ -199,14 +200,13 @@ public interface NameHistoryMapper { time, until, removed_by_reason - FROM ${tableName} AS punishment - WHERE ${name_column} LIKE #{partialName} + FROM ${table_name} AS punishment ORDER BY time DESC LIMIT #{limit} OFFSET #{offset} ) AS punishment INNER JOIN user_lookup ON user_lookup.uuid = punishment.uuid """) - List getRecentHistory(@Param("tableName") String tableName, + List getRecentHistory(@Param("table_name") String tableName, @Param("limit") int limit, @Param("offset") int offset); diff --git a/frontend/src/app/bans/history/history.component.ts b/frontend/src/app/bans/history/history.component.ts index 8dcbee5..c2d6a3d 100644 --- a/frontend/src/app/bans/history/history.component.ts +++ b/frontend/src/app/bans/history/history.component.ts @@ -66,6 +66,9 @@ export class HistoryComponent implements OnInit, OnChanges { let retrySeconds = 5; if (err instanceof HttpErrorResponse) { + if (err.status !== 429) { + return this.history; + } const headers = err.headers; const retryAfterHeader = headers.get('Retry-After'); console.warn(err.error);