Skip to content

Commit

Permalink
improve existing examples for sqlpage 0.7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
lovasoa committed Jul 11, 2023
1 parent 9b75ddc commit fcdf555
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 12 deletions.
4 changes: 1 addition & 3 deletions examples/master-detail-forms/edit_user.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ SELECT 'shell' AS component, 'User Management App' AS title, 'user' AS icon, '/'

SELECT 'form' AS component,
'Edit user' AS title,
CASE WHEN $id IS NULL THEN 'insert_user.sql'
ELSE 'update_user.sql?id=' || $id
END AS action;
'insert_user.sql' || COALESCE('?id=' || $id, '') AS action;

SELECT 'First name' AS name,
TRUE AS required,
Expand Down
4 changes: 2 additions & 2 deletions examples/master-detail-forms/insert_address.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
INSERT INTO address (user_id, street, city, country) VALUES ($user_id, :Street, :City, :Country)
RETURNING
'http_header' AS component,
'edit_user.sql?id=' || user_id AS location;
'redirect' AS component,
'edit_user.sql?id=' || user_id AS link;
4 changes: 2 additions & 2 deletions examples/master-detail-forms/insert_user.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
INSERT INTO user (id, first_name, last_name, email) VALUES ($id, :"First name", :"Last name", :Email)
ON CONFLICT (id) DO UPDATE SET first_name = excluded.first_name, last_name = excluded.last_name, email = excluded.email
RETURNING
'http_header' AS component,
'edit_user.sql?id=' || id AS location;
'redirect' AS component,
'edit_user.sql?id=' || id AS link;
3 changes: 1 addition & 2 deletions examples/official-site/get_started.sql
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
SELECT 'http_header' as component,
'get started.sql' as location;
SELECT 'redirect' as component, 'get started.sql' as link;
3 changes: 1 addition & 2 deletions examples/official-site/manual_setup.sql
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
SELECT 'http_header' as component,
'get started.sql' as location;
SELECT 'redirect' as component, 'get started.sql' as link;
2 changes: 1 addition & 1 deletion examples/read-and-set-http-cookies/logout.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ SELECT 'cookie' as component,
'username' as name,
TRUE as remove;

SELECT 'http_header' as component, 'index.sql' as Location;
SELECT 'redirect' as component, 'index.sql' as link;

0 comments on commit fcdf555

Please sign in to comment.