mirror of
https://github.com/crocofied/CoreControl.git
synced 2025-12-21 09:26:52 +00:00
Add uptimecheckUrl to AddRequest and EditRequest interfaces, updating application creation and editing logic accordingly
This commit is contained in:
parent
65f8e16fbc
commit
3dc2c6b204
@ -8,12 +8,13 @@ interface AddRequest {
|
|||||||
icon: string;
|
icon: string;
|
||||||
publicURL: string;
|
publicURL: string;
|
||||||
localURL: string;
|
localURL: string;
|
||||||
|
uptimecheckUrl: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function POST(request: NextRequest) {
|
export async function POST(request: NextRequest) {
|
||||||
try {
|
try {
|
||||||
const body: AddRequest = await request.json();
|
const body: AddRequest = await request.json();
|
||||||
const { serverId, name, description, icon, publicURL, localURL } = body;
|
const { serverId, name, description, icon, publicURL, localURL, uptimecheckUrl } = body;
|
||||||
|
|
||||||
const application = await prisma.application.create({
|
const application = await prisma.application.create({
|
||||||
data: {
|
data: {
|
||||||
@ -22,7 +23,8 @@ export async function POST(request: NextRequest) {
|
|||||||
description,
|
description,
|
||||||
icon,
|
icon,
|
||||||
publicURL,
|
publicURL,
|
||||||
localURL
|
localURL,
|
||||||
|
uptimecheckUrl
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -9,12 +9,13 @@ interface EditRequest {
|
|||||||
icon: string;
|
icon: string;
|
||||||
publicURL: string;
|
publicURL: string;
|
||||||
localURL: string;
|
localURL: string;
|
||||||
|
uptimecheckUrl: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function PUT(request: NextRequest) {
|
export async function PUT(request: NextRequest) {
|
||||||
try {
|
try {
|
||||||
const body: EditRequest = await request.json();
|
const body: EditRequest = await request.json();
|
||||||
const { id, name, description, serverId, icon, publicURL, localURL } = body;
|
const { id, name, description, serverId, icon, publicURL, localURL, uptimecheckUrl } = body;
|
||||||
|
|
||||||
const existingApp = await prisma.application.findUnique({ where: { id } });
|
const existingApp = await prisma.application.findUnique({ where: { id } });
|
||||||
if (!existingApp) {
|
if (!existingApp) {
|
||||||
@ -29,7 +30,8 @@ export async function PUT(request: NextRequest) {
|
|||||||
description,
|
description,
|
||||||
icon,
|
icon,
|
||||||
publicURL,
|
publicURL,
|
||||||
localURL
|
localURL,
|
||||||
|
uptimecheckUrl
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user