Let a content request carry the record's details, and open its editor
The Request form asks each type for its main details (a chapter's city, meeting time, website and email; an event's dates, venue and registration link...), stored as one JSON column (migration 049). The server only checks the shape; the fields are src/data/requestTypes.ts. Forms → Content requests shows them, and for a new record opens the New editor filled in (URL ID from the name, links and a description paragraph added); for an update, picks the record (closest name first) and opens it with each requested value beside the current one to use or skip. Nothing is saved until Save. Also centres the image and file pickers, which Tailwind's reset had pinned to the top left. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
7876e060e7
commit
4b249c9e52
10 changed files with 529 additions and 22 deletions
|
|
@ -30,7 +30,7 @@ const KIND_WHERE = {
|
|||
content: "feedback_type = 'content'",
|
||||
};
|
||||
const COLUMNS = `id, created_at, feedback_type, message, name, email, page_path, section_id,
|
||||
status, admin_note, category, request_action, subject`;
|
||||
status, admin_note, category, request_action, subject, details`;
|
||||
|
||||
/* Each row with its files (content requests), in one query. */
|
||||
function withFiles(db, rows) {
|
||||
|
|
@ -43,6 +43,8 @@ function withFiles(db, rows) {
|
|||
.all(...rows.map((r) => r.id));
|
||||
return rows.map((row) => ({
|
||||
...row,
|
||||
// Stored as JSON text (049); the admin wants the object.
|
||||
details: row.details ? JSON.parse(row.details) : null,
|
||||
files: files.filter((f) => f.feedback_id === row.id).map(({ feedback_id, ...f }) => f),
|
||||
}));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue