mirror of
https://github.com/traberph/short.git
synced 2026-11-22 22:55:12 +00:00
Create short links directly from the link button dialog
The "Add link button" dialog can now either pick an existing short link or create a new one (destination + optional shortcode) in the page's namespace. The block API accepts `newLink` as an alternative to `targetId`; link and button are created in one transaction, so a failed request leaves nothing behind. Field errors such as a taken shortcode are shown inline, and the label is suggested from the destination's hostname. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -81,6 +81,8 @@ curl -X POST https://short.example.com/~/api/pages \
|
||||
Main endpoints: `GET/POST /pages`, `GET/PATCH/DELETE /pages/:id`, `GET/DELETE /pages/:id/stats?days=7|30|90`, `POST /pages/:id/blocks`, `PUT /pages/:id/blocks/order`, `PATCH/DELETE /blocks/:id`, `PUT /pages/:id/avatar`, `GET/POST/DELETE /tokens`.
|
||||
Admin only: `PUT/DELETE /pin`, `GET /users`, `GET /conflicts`.
|
||||
|
||||
Link buttons can reference an existing short link (`{"kind":"link","label":"…","targetId":12}`) or create one in the page's namespace in the same request (`{"kind":"link","label":"…","newLink":{"dest":"https://…","code":"optional"}}`).
|
||||
|
||||
## Development
|
||||
|
||||
```sh
|
||||
|
||||
Reference in New Issue
Block a user