summaryrefslogtreecommitdiffstats
path: root/src/http/routes/mutations.rs
Commit message (Collapse)AuthorAgeFilesLines
* comments: say why, not whataur-build12 days1-3/+0
| | | | | | | | | | | | | | Every module-level `//!` header is gone, and the comments that remained either re-explained the line below them or had grown into paragraphs. Density went from one comment line per 6.7 lines of code to one per 10. 827 insertions against 2194 deletions across 86 files. What survived: the invariants (I1-I12), the design cross-references into DESIGN.md, and the notes recording a bug that was found and fixed — those are the comments that carry weight, because they answer a question the code cannot answer about itself. What did not: restating a function signature in prose, and narration of the statement underneath.
* http: routes split by direction of travelaur-build13 days1-0/+292
n-4. `routes.rs` was 1,065 lines with the routing table, twenty-odd page renderers, every mutating POST, and the size/date formatting helpers in one file, so finding where a form landed meant scrolling past everything that did not touch it. It is a module now: `routes/mod.rs` keeps the gate, the login handlers, the routing table and the helpers two files share (207 lines); `routes/pages.rs` holds the read side, which only ever goes through `db.read`; `routes/mutations.rs` holds the write side, which is where the audit writes and the flash messages live. The split is by *read versus write*, which is the distinction the crate actually cares about — the read path uses the thread-local read-only connection and must never reach the writer — so the file boundary now matches the invariant rather than being an arbitrary line count. Behaviour is unchanged: the handlers are the same functions, re-exported into `routes` so the routing table still reads as one flat list of endpoints.