Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] Provide an API to know if the third-party services integration settings are configured #2861

Open
1 task done
AiraNadih opened this issue Sep 23, 2024 · 1 comment
Open
1 task done

Comments

@AiraNadih
Copy link

I have reviewed the documentation multiple times but couldn't find an API that allows checking whether the third-party services integration settings are configured.
If such an API already exists, could you please point me to the relevant documentation?
If not, I would like to request the implementation of an API endpoint that provides the ability to determine if third-party services integration settings are configured or not.

This feature would be particularly helpful in scenarios where we need to decide whether or not to display Save option in the UI, based on the configuration status of third-party services.

@AiraNadih
Copy link
Author

If I'm not mistaken, this is the relevant logic:

// HasSaveEntry returns true if the given user can save articles to third-parties.
func (s *Storage) HasSaveEntry(userID int64) (result bool) {
query := `
SELECT
true
FROM
integrations
WHERE
user_id=$1
AND
(
pinboard_enabled='t' OR
instapaper_enabled='t' OR
wallabag_enabled='t' OR
notion_enabled='t' OR
nunux_keeper_enabled='t' OR
espial_enabled='t' OR
readwise_enabled='t' OR
pocket_enabled='t' OR
linkace_enabled='t' OR
linkding_enabled='t' OR
linkwarden_enabled='t' OR
apprise_enabled='t' OR
shiori_enabled='t' OR
readeck_enabled='t' OR
shaarli_enabled='t' OR
webhook_enabled='t' OR
omnivore_enabled='t' OR
raindrop_enabled='t' OR
betula_enabled='t'
)
`
if err := s.db.QueryRow(query, userID).Scan(&result); err != nil {
result = false
}
return result
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant