Collections, above Galleries and Media, where the other things made of media already are. There is no Create button and no Delete, and that is the design rather than an omission. Which collections exist is a question about `originals/COLLECTIONS/`, so making one means making a folder — in Media or in Finder, and both work. A Delete here would either drop the row and leave the photographs, so the collection reappears on the next read, or delete somebody's pictures. Neither is what Delete should mean in an admin. The grid is for choosing the MAIN photo and nothing else. The photographs are already in filename order and the gallery is the folder, so there is nothing to reorder and nothing to add — the one decision is which picture leads. Pressing the chosen one again clears it, which is how "no choice, use the first" stays reachable without a second control that only does that. The badge says Main rather than Cover because it has to be true of the first photograph, which leads by default, as well as of one somebody picked. The fields are the other half — everything a directory cannot tell you: the name it goes by, the address, and the specs from the client's sitemap. `folder` is shown and not editable, and the API refuses to write it: it is an address, and renaming one moves files. Shown anyway, because it is the only thing that says WHICH folder a collection is. One draft, one save. Per-field writes would be eight requests for somebody filling in a form, and the last to land would win in an order nobody controls. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
20 lines
601 B
TypeScript
20 lines
601 B
TypeScript
/** A collection, as the site's admin API serialises one. Snake case: it is the wire, not our shape. */
|
|
export type Collection = {
|
|
id: number;
|
|
folder: string | null;
|
|
title: string;
|
|
slug: string | null;
|
|
/** A FILENAME within the folder, not a path — see the site's schema. */
|
|
cover: string | null;
|
|
description: string | null;
|
|
descriptive_text: string | null;
|
|
measurement: string | null;
|
|
material: string | null;
|
|
colors: string | null;
|
|
delivery_time: string | null;
|
|
sort_order: number;
|
|
photo_count: number;
|
|
};
|
|
|
|
export type CollectionPhoto = { path: string; name: string };
|