Updated names for uniformity

This commit is contained in:
Sean Edmunds
2025-04-28 14:21:45 -05:00
parent f44f6e004b
commit 19b793fbf9
26 changed files with 247 additions and 404 deletions

View File

@@ -15,12 +15,12 @@ const BookmarkSettings = () => {
categoryIndex: 0,
filterName: '',
};
const linksEndpoint = 'api/links';
const { data: linkData, isFetched: linksIsFetched } = useQueryAPI({
endpoint: linksEndpoint,
const bookmarksEndpoint = 'api/bookmarks';
const { data: bookmarkData, isFetched: bookmarksIsFetched } = useQueryAPI({
endpoint: bookmarksEndpoint,
});
const [bookmarks, setBookmarks] = useState<Bookmark[]>([]);
const categoriesEndpoint = 'api/categories';
const categoriesEndpoint = 'api/bookmarkCategories';
const { data: groupData, isFetched: groupsIsFetched } = useQueryAPI({
endpoint: categoriesEndpoint,
});
@@ -60,10 +60,10 @@ const BookmarkSettings = () => {
}
useEffect(() => {
if (linkData && linksIsFetched) {
setBookmarks(linkData);
if (bookmarkData && bookmarksIsFetched) {
setBookmarks(bookmarkData);
}
}, [linksIsFetched, linkData]);
}, [bookmarksIsFetched, bookmarkData]);
useEffect(() => {
if (groupData && groupsIsFetched) {
@@ -98,7 +98,11 @@ const BookmarkSettings = () => {
useEffect(() => {
if (groupList.length > 0 && groupList !== groups) {
mutateAsync({ method: 'PATCH', endpoint: 'api/categoryOrder', body: groupList });
mutateAsync({
method: 'PATCH',
endpoint: 'api/bookmarkCategoryOrder',
body: groupList,
});
}
}, [groupList]);