diff options
author | 2023-09-08 22:45:17 -0700 | |
---|---|---|
committer | 2023-09-09 13:11:42 -0700 | |
commit | 48f6885f4472efbe0e23f990ae8d4545f9a6a73d (patch) | |
tree | a05b35013e65f95013f90006b07870ddaeaf4065 /internal/storage/integration.go | |
parent | 32d33104a4934771ca99b1bcfe55bd0e4e88809b (diff) | |
download | v2-48f6885f4472efbe0e23f990ae8d4545f9a6a73d.tar.gz v2-48f6885f4472efbe0e23f990ae8d4545f9a6a73d.tar.zst v2-48f6885f4472efbe0e23f990ae8d4545f9a6a73d.zip |
Add generic webhook integration
Diffstat (limited to 'internal/storage/integration.go')
-rw-r--r-- | internal/storage/integration.go | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/internal/storage/integration.go b/internal/storage/integration.go index c68168d0..2c1e85a2 100644 --- a/internal/storage/integration.go +++ b/internal/storage/integration.go @@ -167,7 +167,10 @@ func (s *Storage) Integration(userID int64) (*model.Integration, error) { shiori_password, shaarli_enabled, shaarli_url, - shaarli_api_secret + shaarli_api_secret, + webhook_enabled, + webhook_url, + webhook_secret FROM integrations WHERE @@ -234,6 +237,9 @@ func (s *Storage) Integration(userID int64) (*model.Integration, error) { &integration.ShaarliEnabled, &integration.ShaarliURL, &integration.ShaarliAPISecret, + &integration.WebhookEnabled, + &integration.WebhookURL, + &integration.WebhookSecret, ) switch { case err == sql.ErrNoRows: @@ -308,9 +314,12 @@ func (s *Storage) UpdateIntegration(integration *model.Integration) error { shiori_password=$55, shaarli_enabled=$56, shaarli_url=$57, - shaarli_api_secret=$58 + shaarli_api_secret=$58, + webhook_enabled=$59, + webhook_url=$60, + webhook_secret=$61 WHERE - user_id=$59 + user_id=$62 ` _, err := s.db.Exec( query, @@ -372,6 +381,9 @@ func (s *Storage) UpdateIntegration(integration *model.Integration) error { integration.ShaarliEnabled, integration.ShaarliURL, integration.ShaarliAPISecret, + integration.WebhookEnabled, + integration.WebhookURL, + integration.WebhookSecret, integration.UserID, ) |