Skip to content

Commit 110d877

Browse files
committed
fix old bugs, run formatter
1 parent d90d604 commit 110d877

File tree

10 files changed

+361
-231
lines changed

10 files changed

+361
-231
lines changed

schema.sql

+4-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ drop table if exists problems;
3131
create table problems (
3232
id integer primary key,
3333
title text not null,
34-
description text not null
34+
description_raw text not null,
35+
description_rendered text not null
3536
);
3637

3738
drop table if exists submissions;
@@ -40,6 +41,8 @@ create table submissions (
4041
user_id integer not null,
4142
problem_id integer not null,
4243
code text not null,
44+
lang text not null,
45+
other text not null,
4346
created_at integer not null default (unixepoch()),
4447

4548
foreign key(user_id) references users(id) on delete cascade,

src/auth.ts

-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ export const authenticated = (
6363
next: () => void,
6464
) => {
6565
if (!req.session.user) {
66-
6766
// @ts-expect-error
6867
res.redirect("/login");
6968
} else {

src/constants.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@ export const DISCORD_OAUTH_URL = demand(
3232
"DISCORD_OAUTH_URL",
3333
process.env.DISCORD_OAUTH_URL,
3434
);
35-
export const COOKIE_SECRET = demand(
36-
"COOKIE_SECRET",
37-
process.env.COOKIE_SECRET,
38-
);
35+
export const COOKIE_SECRET = demand("COOKIE_SECRET", process.env.COOKIE_SECRET);
3936

4037
export const NODE_ENV = process.env.NODE_ENV || "development";
4138
export const IS_PROD = NODE_ENV === "production";

src/db.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ export interface DatabaseUser {
1616
}
1717

1818
export interface DatabaseProblem {
19-
id: number;
20-
title: string;
21-
description: string;
19+
id: number;
20+
title: string;
21+
description: string;
2222
}
2323

2424
export interface DatabaseSubmission {
25-
id: number;
26-
user_id: number;
27-
problem_id: number;
28-
code: string;
29-
created_at: string;
30-
}
25+
id: number;
26+
user_id: number;
27+
problem_id: number;
28+
code: string;
29+
created_at: string;
30+
}

0 commit comments

Comments
 (0)