v2.0: sound library, image upload, DnD, ResourceBrowser, Barotrauma HUD, captain sanity
Deploy / build-and-deploy (push) Failing after 52s
Deploy / build-and-deploy (push) Failing after 52s
This commit is contained in:
@@ -20,7 +20,7 @@ export async function POST(req: NextRequest, { params }: { params: Promise<{ cam
|
||||
}
|
||||
try {
|
||||
const { campaignId } = await params;
|
||||
const { text, emoji, soundCategory, soundUrl, gridIndex } = await req.json();
|
||||
const { text, emoji, soundCategory, soundUrl, imageUrl, gridIndex } = await req.json();
|
||||
if (!text) return NextResponse.json({ error: "Text required" }, { status: 400 });
|
||||
|
||||
const existing = db.select().from(bingoItems)
|
||||
@@ -32,7 +32,7 @@ export async function POST(req: NextRequest, { params }: { params: Promise<{ cam
|
||||
|
||||
const id = uuidv4();
|
||||
const now = new Date().toISOString();
|
||||
db.insert(bingoItems).values({ id, campaignId, text, emoji: emoji || "💀", soundCategory: soundCategory || "horn", soundUrl: soundUrl || null, gridIndex, createdAt: now }).run();
|
||||
db.insert(bingoItems).values({ id, campaignId, text, emoji: emoji || "💀", soundCategory: soundCategory || "horn", soundUrl: soundUrl || null, imageUrl: imageUrl || null, gridIndex, createdAt: now }).run();
|
||||
return NextResponse.json({ id });
|
||||
} catch {
|
||||
return NextResponse.json({ error: "Failed to add item" }, { status: 500 });
|
||||
@@ -49,10 +49,11 @@ export async function PUT(req: NextRequest, { params }: { params: Promise<{ camp
|
||||
const body = await req.json();
|
||||
if (!body.id) return NextResponse.json({ error: "Item ID required" }, { status: 400 });
|
||||
const updates: Record<string, unknown> = {};
|
||||
if (body.text) updates.text = body.text;
|
||||
if (body.emoji) updates.emoji = body.emoji;
|
||||
if (body.soundCategory) updates.soundCategory = body.soundCategory;
|
||||
if (body.text !== undefined) updates.text = body.text;
|
||||
if (body.emoji !== undefined) updates.emoji = body.emoji;
|
||||
if (body.soundCategory !== undefined) updates.soundCategory = body.soundCategory;
|
||||
if (body.soundUrl !== undefined) updates.soundUrl = body.soundUrl;
|
||||
if (body.imageUrl !== undefined) updates.imageUrl = body.imageUrl;
|
||||
if (body.gridIndex !== undefined) updates.gridIndex = body.gridIndex;
|
||||
db.update(bingoItems).set(updates)
|
||||
.where(and(eq(bingoItems.id, body.id), eq(bingoItems.campaignId, campaignId)))
|
||||
|
||||
Reference in New Issue
Block a user