Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't vomit on legacy bans
  • Loading branch information
regalijan committed Oct 29, 2023
1 parent f6429be commit 925f3ae
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion functions/api/game-appeals/precheck.ts
Expand Up @@ -6,7 +6,9 @@ export default async function (
user: number,
): Promise<{ can_appeal?: boolean; error?: string; reason?: string }> {
if (
await context.env.D1.prepare("SELECT * FROM game_appeals WHERE open = 1 AND user = ?;")
await context.env.D1.prepare(
"SELECT * FROM game_appeals WHERE open = 1 AND user = ?;",
)
.bind(user)
.first()
)
Expand Down Expand Up @@ -43,6 +45,9 @@ export default async function (
};
}

// Legacy bans
if (!userLogs.length) return { can_appeal: true, reason: "" };

userLogs.sort((a, b) =>
parseInt(a.entity.properties.executed_at.integerValue) >
parseInt(b.entity.properties.executed_at.integerValue)
Expand Down

0 comments on commit 925f3ae

Please sign in to comment.