Updated names for uniformity
This commit is contained in:
@@ -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]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user