Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 1853180f

Přidáno uživatelem Fantič před téměř 2 roky(ů)

re 10678: ItemNotes: fix create item note api call

Zobrazit rozdíly:

src/components/item/ItemView.tsx
123 123

  
124 124
    const [showRelatedComments, setShowRelatedComments] = useState(true);
125 125

  
126
    const { requestPending } = useSelector((state: RootState) => state.noteViewState)
126
    const { requestPending, triggerRefresh } = useSelector((state: RootState) => state.noteViewState)
127 127

  
128 128
    const dispatch = useDispatch<AppDispatch>();
129 129

  
130
    // trigger refresh on triggerRefresh increment
131
    useEffect(() => {
132
        if(triggerRefresh > 0){
133
            log.debug("NotesViewPage", "useEffect", "getNotes");
134
            dispatch(getItemNotes({ item: props.item, relatedComments: showRelatedComments }));
135
        }
136
    }, [triggerRefresh])
137

  
130 138
    const toggleRelatedComments = () => {
131 139
        if (!props.notesLoading) {
132 140

  
......
147 155
            }
148 156
            else {
149 157
                dispatch(createNote({
150
                    newNote: { note: newComment, items: [props.item.id] } as Note
158
                    newNote: { note: newComment, items: props.item.id } as any
151 159
                }))
152 160
            }
153 161
        }

Také k dispozici: Unified diff