Don't vomit on legacy bans
This commit is contained in:
parent
f6429be055
commit
925f3aeedf
@ -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()
|
||||
)
|
||||
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user