student table optimization adn docker testing

This commit is contained in:
Om Lanke
2025-07-02 22:10:56 +05:30
parent 449629ece2
commit 0032a4743c
18 changed files with 297 additions and 19 deletions

View File

@@ -1,19 +1,13 @@
import Login from '@/components/login';
import Studs from '@/components/studs';
import { db, admins } from '@workspace/db';
import { auth, signIn, signOut } from '@/auth';
import { db, students } from '@workspace/db';
import { auth, signOut } from '@/auth';
async function getStudents() {
'use server';
const s = await db.select().from(admins);
const s = await db.select().from(students);
console.log(s);
}
async function logIn() {
'use server';
await signIn('google');
}
async function logOut() {
'use server';
await signOut();
@@ -25,7 +19,6 @@ export default async function Page() {
<div className="flex items-center justify-center min-h-svh">
<div className="flex flex-col items-center justify-center gap-4">
<h1 className="text-2xl font-bold">Hello admin {session?.user?.name}</h1>
{!session?.user && <Login action={logIn} />}
<Studs action={getStudents} logOut={logOut} />
</div>
</div>