Release 0.5.3

This commit is contained in:
hnzio committed 2026-10-22 14:18:57 +02:00
1 parent 25da870601
commit f466df2c5c
13 files changed
+1367 -771

No files matched your search

+3 -4
View File
@@ -1,4 +1,4 @@
import { fail, redirect } from '@sveltejs/kit';
import { fail } from '@sveltejs/kit';
import type { Actions, PageServerLoad } from './$types';
import { requireUser } from '#lib/server/auth.js';
import { captureInbox, listPieces } from '#lib/server/content.js';
@@ -12,9 +12,9 @@ export const actions = {
capture: async ({ locals, request }) => {
requireUser(locals.user);
const data = await request.formData();
let id: string;
try {
id = captureInbox(String(data.get('title') || ''), String(data.get('url') || ''));
const id = captureInbox(String(data.get('title') || ''), String(data.get('url') || ''));
return { captured: true, capturedId: id };
} catch (cause) {
const code = cause instanceof Error ? cause.message : '';
return fail(400, {
@@ -26,6 +26,5 @@ export const actions = {
: 'Ein Titel ist erforderlich.'
});
}
redirect(303, `/fundus/${id}`);
}
} satisfies Actions;
+6 -3
View File
@@ -17,11 +17,14 @@
<h2>Was soll nicht verloren gehen?</h2>
</div>
{#if form?.error}<div class="form-message error" role="alert">{form.error}</div>{/if}
{#if form?.captured}<div class="form-message success" role="status">
Im Eingang gespeichert.
<a href={resolve('/fundus/[id]', { id: form.capturedId })}>Jetzt ausarbeiten</a>
</div>{/if}
<form method="POST" action="?/capture" class="capture-form">
<label
>Titel oder Gedanke<input
>Gedanke <span>optional bei URL</span><input
name="title"
required
maxlength="200"
value={form?.title ?? ''}
placeholder="Kurze Idee festhalten"
@@ -36,7 +39,7 @@
placeholder="https://…"
/></label
>
<button class="primary-button" type="submit">Aufnehmen und öffnen</button>
<button class="primary-button" type="submit">Im Eingang ablegen</button>
</form>
</section>
{#if data.pieces.length}