frontend added and socket io
This commit is contained in:
@@ -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, {
|
||||
|
||||
Reference in New Issue
Block a user