mirror of
https://github.com/miniflux/v2.git
synced 2025-08-11 17:51:01 +00:00
Use a SQL transaction when creating users
This commit is contained in:
parent
651ee02c11
commit
7be9f5989e
2 changed files with 29 additions and 20 deletions
|
@ -175,17 +175,6 @@ func (s *Storage) UpdateIntegration(integration *model.Integration) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// CreateIntegration creates initial user integration settings.
|
||||
func (s *Storage) CreateIntegration(userID int64) error {
|
||||
query := `INSERT INTO integrations (user_id) VALUES ($1)`
|
||||
_, err := s.db.Exec(query, userID)
|
||||
if err != nil {
|
||||
return fmt.Errorf(`store: unable to create integration row: %v`, err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// HasSaveEntry returns true if the given user can save articles to third-parties.
|
||||
func (s *Storage) HasSaveEntry(userID int64) (result bool) {
|
||||
query := `
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue