refactor(media): use asset-centric storage key layout
This commit is contained in:
@@ -44,10 +44,15 @@ export function MediaUploadForm() {
|
||||
|
||||
const payload = (await response.json().catch(() => null)) as {
|
||||
notice?: string
|
||||
provider?: "s3" | "local"
|
||||
warning?: string
|
||||
} | null
|
||||
|
||||
const notice = payload?.notice ?? "Media uploaded."
|
||||
window.location.href = `/media?notice=${encodeURIComponent(notice)}`
|
||||
const provider = payload?.provider ?? "local"
|
||||
const warning = payload?.warning
|
||||
const warningQuery = warning ? `&warning=${encodeURIComponent(warning)}` : ""
|
||||
window.location.href = `/media?notice=${encodeURIComponent(notice)}&uploadedVia=${encodeURIComponent(provider)}${warningQuery}`
|
||||
} catch {
|
||||
setError("Upload request failed. Please retry.")
|
||||
} finally {
|
||||
@@ -68,8 +73,7 @@ export function MediaUploadForm() {
|
||||
<span className="text-xs text-neutral-600">Title</span>
|
||||
<input
|
||||
name="title"
|
||||
required
|
||||
minLength={1}
|
||||
placeholder="Optional (defaults to file name)"
|
||||
className="w-full rounded border border-neutral-300 px-3 py-2 text-sm"
|
||||
/>
|
||||
</label>
|
||||
|
||||
Reference in New Issue
Block a user