adds user accounts, service requests, dashboard, admin panel, better layout, db+altcha+auth support
This commit is contained in:
parent
dfbc3cade9
commit
0043a5bf3c
40 changed files with 3981 additions and 188 deletions
24
app/api/services/route.ts
Normal file
24
app/api/services/route.ts
Normal file
|
@ -0,0 +1,24 @@
|
|||
import { db } from "@/db";
|
||||
import { services } from "@/db/schema";
|
||||
import { eq } from "drizzle-orm";
|
||||
|
||||
export async function GET() {
|
||||
try {
|
||||
const publicServices = await db.select({
|
||||
id: services.id,
|
||||
name: services.name,
|
||||
description: services.description,
|
||||
priceStatus: services.priceStatus,
|
||||
joinLink: services.joinLink,
|
||||
enabled: services.enabled
|
||||
})
|
||||
.from(services)
|
||||
.where(eq(services.enabled, true))
|
||||
.orderBy(services.name);
|
||||
|
||||
return Response.json({ services: publicServices });
|
||||
} catch (error) {
|
||||
console.error("Error fetching public services:", error);
|
||||
return Response.json({ error: "Internal server error" }, { status: 500 });
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue