Applications need a Server

This commit is contained in:
headlessdev
2025-04-12 13:19:52 +02:00
parent 0506731a12
commit 43b7b3b270
12 changed files with 200 additions and 105 deletions

View File

@@ -2,6 +2,7 @@ import { NextResponse, NextRequest } from "next/server";
import { PrismaClient } from '@/lib/generated/prisma'
interface AddRequest {
serverId: number;
name: string;
description: string;
icon: string;
@@ -14,10 +15,11 @@ const prisma = new PrismaClient();
export async function POST(request: NextRequest) {
try {
const body: AddRequest = await request.json();
const { name, description, icon, publicURL, localURL } = body;
const { serverId, name, description, icon, publicURL, localURL } = body;
const application = await prisma.application.create({
data: {
serverId,
name,
description,
icon,