Skip to content

fix: map prompt topic ID from database rows - #626

Merged
gkhngyk merged 1 commit into
ansvisor:mainfrom
BharadwajKanneveti:fix/export-prompt-topic-id
Aug 3, 2026
Merged

gkhngyk merged 1 commit into
ansvisor:mainfrom
BharadwajKanneveti:fix/export-prompt-topic-id

Conversation

@BharadwajKanneveti

Copy link
Copy Markdown
Contributor

Summary

Fixes the prompt mapping so topic_id is preserved when converting database rows into Prompt objects.

Changes

  • Added topicId to mapPromptRow by mapping the topic_id database column to the Prompt model.
  • No query changes were required since getPromptSets already selects prompts(*), which includes topic_id.

This ensures prompts with an associated topic export a non-empty topic_id in the CSV, while prompts without a topic continue to export an empty cell.

Related issue

Closes #590

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/)
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly the one-line fix from the issue. Thanks!

@gkhngyk
gkhngyk merged commit 97a36f4 into ansvisor:main Aug 3, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prompts: CSV export writes an always-empty topic_id column

2 participants