fix(ui): notes list pagination

This commit is contained in:
Shekar Siri 2024-11-15 15:08:44 +01:00
parent 0115f6e604
commit ea53e7ce48

View file

@ -10,8 +10,8 @@ function NotesList() {
const { notesStore } = useStore();
React.useEffect(() => {
notesStore.fetchNotes();
}, []);
void notesStore.fetchNotes();
}, [notesStore.page]);
const list = notesStore.notes;
@ -33,7 +33,7 @@ function NotesList() {
}
>
<div className="border-b rounded bg-white">
{sliceListPerPage(list, notesStore.page - 1, notesStore.pageSize).map((note) => (
{list.map((note) => (
<React.Fragment key={note.noteId}>
<NoteItem note={note} />
</React.Fragment>