configure reviewer

This commit is contained in:
Ian Gulliver
2026-10-18 22:56:33 -07:00
parent 380e533ef4
commit 374ccf8b5e
10 changed files with 394 additions and 291 deletions
+14
View File
@@ -39,3 +39,17 @@ func (s *Store) UpdateDefaultModel(ctx context.Context, login, model string) (ap
}
return s.GetUser(ctx, login)
}
func (s *Store) UpdateReviewModels(ctx context.Context, login, model, second string) (api.User, error) {
err := s.write(ctx, func(tx *sql.Tx, emit emitFunc) error {
_, err := tx.ExecContext(ctx, `UPDATE users SET review_model = ?, second_review_model = ? WHERE login = ?`, model, second, login)
if err != nil {
return err
}
return emit(api.Event{Kind: "user.updated", Actor: login, Payload: map[string]any{"login": login}})
})
if err != nil {
return api.User{}, err
}
return s.GetUser(ctx, login)
}