1
0

chore: package

This commit is contained in:
2025-07-05 01:34:59 +02:00
parent 8e324b2a1f
commit 9e411cee54
16 changed files with 424 additions and 4 deletions

31
webroot/add_instance.sql Normal file
View File

@@ -0,0 +1,31 @@
-- TODO check for duplicate to avoid
-- error returned from database: (code: 2067) UNIQUE constraint failed: instances.domain
select
'alert' as component
, 'Error' as title
, 'domain must be minimum four characters' as description
, 'alert-circle' as icon
, 'red' as color
where length($domain) <4
or $domain is null
;
-- TODO perform better validation of the domain
insert into instances(domain, failure) select $domain, -1
where length($domain) >3
and $domain is not null
;
select
'empty_state' as component
, 'mood-check' as icon
, 'Thanks you' as title
, 'This domain ' || $domain || ' has been added to the list and will be be displayed after next refresh, usually once a day' as description
, 'Go back to the list' as link_text
, 'home' as link_icon
, '/' as link
where length($domain) >3
and $domain is not null
;