Edit of links and database versioning
This commit is contained in:
@@ -241,3 +241,33 @@ git commit the whole lot
|
||||
|
||||
### Assistant outcome
|
||||
Ran the strict backend suite with 10 passing tests, staged all project changes, expanded `.gitignore` to exclude runtime avatar uploads, confirmed `.env`, caches, virtualenv files, bytecode, databases, and generated assets were not staged, and created the complete-project commit.
|
||||
|
||||
### User
|
||||
version the sql schema and make sure it can be upgraded in the future.
|
||||
|
||||
### Assistant outcome
|
||||
Replaced the unversioned schema bootstrap with ordered SQLite migrations using `PRAGMA user_version`. The current schema is migration 1, migrations are applied in order and are idempotent, and a database migration test verifies version tracking and table preservation. README migration guidance was added. The strict backend suite passed with 11 tests.
|
||||
|
||||
### User
|
||||
allow editing of individual links - add a edit button for the links owned by the authenticated user - otherwise do not show a link
|
||||
|
||||
### Assistant outcome
|
||||
Added owner-checked `PUT /api/links/{link_id}` updates and `can_edit` feed metadata based on the authenticated bearer token. The feed shows an inline Edit action only for the current user's links; anonymous viewers and other users receive no edit action. Added owner/permission regression coverage, bumped the feed asset to `v5`, and the strict backend suite passed with 12 tests.
|
||||
|
||||
### User
|
||||
Add authenticated link editing
|
||||
|
||||
### Assistant outcome
|
||||
Verified and strengthened the existing authenticated link-editing flow. Anonymous updates return `401`, owners can edit their links, non-owners receive `404`, and the browser only renders the Edit action when feed metadata has `can_edit: true`. Full strict backend validation passed with 12 tests.
|
||||
|
||||
### User
|
||||
Expose ownership if feed data
|
||||
|
||||
### Assistant outcome
|
||||
Added explicit `is_owner` metadata to each public feed item based on the authenticated bearer token. Anonymous and non-owner responses return `false`; the owner receives `true`. The feed Edit control now uses this field, and the strict backend suite passed with 12 tests.
|
||||
|
||||
### User
|
||||
Render edit action for owned links
|
||||
|
||||
### Assistant outcome
|
||||
Verified that the feed renders the Edit button only when `is_owner` is true, while the backend owner check remains enforced by `PUT /api/links/{link_id}`. The live Docker-served feed asset contains the owner-gated action, focused tests passed, and the full strict suite passed with 12 tests.
|
||||
|
||||
Reference in New Issue
Block a user