WIP 1.51.8: frontend on v2 for event detail, options, sections, attachments, costs, uploads

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ls1vMdg2GYqbnKZmPaX1ot
This commit is contained in:
2026-10-29 12:14:01 +02:00
co-authored by Claude Opus 5.5
parent 96b9b8c23f
commit d1927cd334
23 changed files with 196 additions and 161 deletions
@@ -2,8 +2,8 @@
import React, { useRef, useState } from "react";
import { useAuth } from "@/hooks/useAuth";
import { apiFetch } from "@/lib/api";
import { errorMessage } from "@/lib/utils";
import { uploadImage } from "@/lib/eventSetup";
export function FileUploader({ onUploaded }: { onUploaded: (url: string) => void }) {
const { token } = useAuth();
@@ -16,14 +16,7 @@ export function FileUploader({ onUploaded }: { onUploaded: (url: string) => void
setLoading(true);
setError(null);
try {
const fd = new FormData();
fd.append("image", file);
const data = await apiFetch<{ url: string }>(`/api/uploads/event-image`, {
method: "POST",
body: fd,
authToken: token,
});
onUploaded(data.url);
onUploaded(await uploadImage(token, "event-image", file));
} catch (e) {
setError(errorMessage(e) || "Upload failed");
} finally {