Revert "Add missing admin action files and navigation links"

This reverts commit 41be6835bf.
This commit is contained in:
Simo committed 2026-07-11 20:37:56 +02:00
1 parent 4a1e1115b3
commit 4d515bc400
338 files changed
+5949 -28144

No files matched your search

+10 -32
View File
@@ -30,9 +30,7 @@ function reqUInt(formData: FormData, key: string): number {
export async function createShopArticle(formData: FormData): Promise<void> {
const staff = await requireStaff();
const name = String(formData.get("name") ?? "")
.trim()
.slice(0, 255);
const name = String(formData.get("name") ?? "").trim().slice(0, 255);
if (!name) return;
const now = new Date();
@@ -40,24 +38,15 @@ export async function createShopArticle(formData: FormData): Promise<void> {
const created = await prisma.websiteShopArticles.create({
data: {
name,
info: String(formData.get("info") ?? "")
.trim()
.slice(0, 255),
iconUrl: String(formData.get("icon") ?? "")
.trim()
.slice(0, 255),
color: String(formData.get("color") ?? "")
.trim()
.slice(0, 255),
info: String(formData.get("info") ?? "").trim().slice(0, 255),
iconUrl: String(formData.get("icon") ?? "").trim().slice(0, 255),
color: String(formData.get("color") ?? "").trim().slice(0, 255),
costs: reqUInt(formData, "costs"),
giveRank: optUInt(formData, "giveRank"),
credits: optUInt(formData, "credits"),
duckets: optUInt(formData, "duckets"),
diamonds: optUInt(formData, "diamonds"),
badges:
String(formData.get("badges") ?? "")
.trim()
.slice(0, 255) || null,
badges: (String(formData.get("badges") ?? "").trim().slice(0, 255)) || null,
position: reqUInt(formData, "position"),
createdAt: now,
updatedAt: now,
@@ -85,9 +74,7 @@ export async function updateShopArticle(formData: FormData): Promise<void> {
const id = formPositiveBigInt(formData, "id");
if (!id) return;
const name = String(formData.get("name") ?? "")
.trim()
.slice(0, 255);
const name = String(formData.get("name") ?? "").trim().slice(0, 255);
if (!name) return;
try {
@@ -95,24 +82,15 @@ export async function updateShopArticle(formData: FormData): Promise<void> {
where: { id },
data: {
name,
info: String(formData.get("info") ?? "")
.trim()
.slice(0, 255),
iconUrl: String(formData.get("icon") ?? "")
.trim()
.slice(0, 255),
color: String(formData.get("color") ?? "")
.trim()
.slice(0, 255),
info: String(formData.get("info") ?? "").trim().slice(0, 255),
iconUrl: String(formData.get("icon") ?? "").trim().slice(0, 255),
color: String(formData.get("color") ?? "").trim().slice(0, 255),
costs: reqUInt(formData, "costs"),
giveRank: optUInt(formData, "giveRank"),
credits: optUInt(formData, "credits"),
duckets: optUInt(formData, "duckets"),
diamonds: optUInt(formData, "diamonds"),
badges:
String(formData.get("badges") ?? "")
.trim()
.slice(0, 255) || null,
badges: (String(formData.get("badges") ?? "").trim().slice(0, 255)) || null,
position: reqUInt(formData, "position"),
updatedAt: new Date(),
},