2026-10-15 18:34:53 -07:00
|
|
|
package store
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
|
2026-10-18 15:32:07 -07:00
|
|
|
"g.fc.run/ai/byre/internal/api"
|
2026-10-15 18:34:53 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func (s *Store) UpdateNotificationPrefs(ctx context.Context, login string, prefs api.NotificationPrefs) (api.User, error) {
|
2026-10-21 11:45:37 -07:00
|
|
|
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)
|
2026-10-15 18:34:53 -07:00
|
|
|
}
|
2026-10-18 00:57:51 -07:00
|
|
|
|
|
|
|
|
func (s *Store) UpdateDefaultModel(ctx context.Context, login, model string) (api.User, error) {
|
2026-10-21 11:45:37 -07:00
|
|
|
return s.updateUser(ctx, login, `default_model = ?`, model)
|
2026-10-18 00:57:51 -07:00
|
|
|
}
|
2026-10-18 22:56:33 -07:00
|
|
|
|
2026-10-19 21:40:24 -07:00
|
|
|
func (s *Store) UpdateAway(ctx context.Context, login string, away bool) (api.User, error) {
|
2026-10-21 11:45:37 -07:00
|
|
|
return s.updateUser(ctx, login, `away = ?`, away)
|
2026-10-19 21:40:24 -07:00
|
|
|
}
|