Private
Public Access
1
0

feat: Adding animations for map actions + getting rid of debugMode

This commit is contained in:
gauvainboiche
2026-04-01 19:14:58 +02:00
parent f161ccb0f0
commit ddd5f6ae72
10 changed files with 59 additions and 16 deletions

View File

@@ -9,7 +9,6 @@ export async function initUsersSchema() {
username TEXT NOT NULL UNIQUE,
password_hash TEXT NOT NULL,
team TEXT NOT NULL CHECK (team IN ('blue', 'red')),
role TEXT NOT NULL DEFAULT 'user' CHECK (role IN ('user', 'admin')),
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
`);
@@ -44,7 +43,7 @@ export async function createUser(username, passwordHash, team) {
const { rows } = await usersPool.query(
`INSERT INTO users (username, password_hash, team)
VALUES ($1, $2, $3)
RETURNING id, username, team, role`,
RETURNING id, username, team`,
[username, passwordHash, team]
);
return rows[0];
@@ -52,7 +51,7 @@ export async function createUser(username, passwordHash, team) {
export async function getUserByUsername(username) {
const { rows } = await usersPool.query(
`SELECT id, username, team, role, password_hash FROM users WHERE username = $1`,
`SELECT id, username, team, password_hash FROM users WHERE username = $1`,
[username]
);
return rows[0] ?? null;
@@ -60,7 +59,7 @@ export async function getUserByUsername(username) {
export async function getUserById(id) {
const { rows } = await usersPool.query(
`SELECT id, username, team, role FROM users WHERE id = $1`,
`SELECT id, username, team FROM users WHERE id = $1`,
[id]
);
return rows[0] ?? null;