Ignore:
Timestamp:
07/02/26 23:35:59 (3 days ago)
Author:
kikisrbinoska <srbinoskakristina07@…>
Branches:
main
Parents:
3ae4bab
Message:

AI suggestions fixed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chapterx-frontend/src/components/writer/AISuggestionPanel.tsx

    r3ae4bab ra6e33d1  
    100100}
    101101
    102 export const AISuggestionPanel: React.FC<AISuggestionPanelProps> = ({ chapterId, storyId }) => {
     102export const AISuggestionPanel: React.FC<AISuggestionPanelProps> = ({ chapterId }) => {
    103103  const { aiSuggestions, acceptSuggestion, rejectSuggestion, fetchSuggestions } = useStoryStore()
    104104  const { addToast } = useUIStore()
     
    108108  useEffect(() => {
    109109    setLoading(true)
    110     fetchSuggestions().finally(() => setLoading(false))
     110    fetchSuggestions(chapterId).finally(() => setLoading(false))
    111111  }, [chapterId])
    112112
    113   // Filter by storyId if available (backend), else fall back to chapterId (mock)
    114   const chapterSuggestions = aiSuggestions.filter(s =>
    115     storyId ? (s as any).story_id === storyId : s.chapter_id === chapterId
    116   )
     113  // Backend already scopes results to this chapter via NEED_APPROVAL
     114  const chapterSuggestions = aiSuggestions
    117115  const pending = chapterSuggestions.filter(s => s.accepted === null)
    118116  const accepted = chapterSuggestions.filter(s => s.accepted === true)
Note: See TracChangeset for help on using the changeset viewer.