Add thread rename support
This commit is contained in:
@@ -421,6 +421,18 @@ func (s *Store) TouchThread(ctx context.Context, codexThreadID string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *Store) RenameThread(ctx context.Context, telegramUserID, id int64, title string) error {
|
||||
_, err := s.db.ExecContext(ctx, `
|
||||
UPDATE threads SET title = ?, updated_at = datetime('now')
|
||||
WHERE telegram_user_id = ? AND id = ?`, title, telegramUserID, id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *Store) RenameThreadByCodexID(ctx context.Context, codexThreadID, title string) error {
|
||||
_, err := s.db.ExecContext(ctx, "UPDATE threads SET title = ?, updated_at = datetime('now') WHERE codex_thread_id = ?", title, codexThreadID)
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *Store) UpsertPendingApproval(ctx context.Context, approval PendingApproval) (PendingApproval, error) {
|
||||
_, err := s.db.ExecContext(ctx, `
|
||||
INSERT INTO pending_approvals (
|
||||
|
||||
Reference in New Issue
Block a user