Skip to content

Commit 5ec0335

Browse files
committed
list delete with POST requests
1 parent b236a87 commit 5ec0335

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

examples/official-site/sqlpage/migrations/01_documentation.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ INSERT INTO parameter(component, name, description, type, top_level, optional) S
5151
('active', 'Whether this item in the list is considered "active". Active items are displayed more prominently.', 'BOOLEAN', FALSE, TRUE),
5252
('view_link', 'A URL to which the user should be taken when they click on the "view" icon. Does not show the icon when omitted.', 'URL', FALSE, TRUE),
5353
('edit_link', 'A URL to which the user should be taken when they click on the "edit" icon. Does not show the icon when omitted.', 'URL', FALSE, TRUE),
54-
('delete_link', 'A URL to which the user should be taken when they click on the "delete" icon. Does not show the icon when omitted.', 'URL', FALSE, TRUE)
54+
('delete_link', 'A page that will be loaded when the user clicks on the delete button for this specific item. The link will be submitted as a POST request.', 'URL', FALSE, TRUE)
5555
) x;
5656

5757
INSERT INTO example(component, description, properties) VALUES

sqlpage/templates/list.handlebars

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,11 @@
4747
{{/if}}
4848

4949
{{#if delete_link}}
50-
<a href="{{delete_link}}" class="link-secondary col-auto" title="Delete">
51-
{{~icon_img 'trash'~}}
52-
</a>
50+
<form method="POST" action="{{delete_link}}" class="col-auto m-0 p-0">
51+
<button type="submit" class="btn btn-link link-secondary p-0 border-0" title="Delete">
52+
{{~icon_img 'trash'~}}
53+
</button>
54+
</form>
5355
{{/if}}
5456

5557
{{#if edit_link}}

0 commit comments

Comments
 (0)