frontend added and socket io

This commit is contained in:
2026-03-16 18:07:23 -05:00
parent 81dc575b4f
commit 5db2a7fe75
45 changed files with 11947 additions and 5546 deletions

View File

@@ -1,5 +1,5 @@
import { APIError } from "better-auth";
import { count, sql } from "drizzle-orm";
import { count, eq, sql } from "drizzle-orm";
import { Router } from "express";
import z from "zod";
import { db } from "../db/db.controller.js";
@@ -58,7 +58,10 @@ r.post("/", async (req, res) => {
// if we have no users yet lets make this new one the admin
if (userCount === 0) {
// make this user an admin
await db.update(user).set({ role: "admin", updatedAt: sql`NOW()` });
await db
.update(user)
.set({ role: "admin", updatedAt: sql`NOW()` })
.where(eq(user.id, newUser.user.id));
}
apiReturn(res, {