Files
byre/internal/store/notifications.go
T

21 lines
845 B
Go

package store
import (
"context"
"g.fc.run/ai/byre/internal/api"
)
func (s *Store) UpdateNotificationPrefs(ctx context.Context, login string, prefs api.NotificationPrefs) (api.User, error) {
return s.updateUser(ctx, login, `notify_questions = ?, notify_reports = ?, notify_errors = ?, notify_rate_limits = ?, notify_ready = ?, notify_discard = ?, notify_merge_problems = ?, notify_workflows = ?`,
prefs.Questions, prefs.Reports, prefs.Errors, prefs.RateLimits, prefs.Ready, prefs.Discard, prefs.MergeProblems, prefs.Workflows)
}
func (s *Store) UpdateDefaultModel(ctx context.Context, login, model string) (api.User, error) {
return s.updateUser(ctx, login, `default_model = ?`, model)
}
func (s *Store) UpdateAway(ctx context.Context, login string, away bool) (api.User, error) {
return s.updateUser(ctx, login, `away = ?`, away)
}