Modified endpoint to properly filter Bookmarks based on Hidden flag on both the Bookmark entry itself and its associated tags
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import { isDev } from "./isDevHelper";
|
||||
import { getTagGroups } from "./tagsHelper";
|
||||
import { getTagGroups, flattenTagArrays } from "./tagsHelper";
|
||||
import { isSubset } from "./arrayHelper";
|
||||
import { containsSubstring } from "./bookmarkHelper";
|
||||
|
||||
@ -7,5 +7,6 @@ export {
|
||||
isDev,
|
||||
getTagGroups,
|
||||
isSubset,
|
||||
containsSubstring
|
||||
containsSubstring,
|
||||
flattenTagArrays
|
||||
}
|
||||
@ -14,4 +14,12 @@ export const getTagGroups = (allBookmarkTags) => {
|
||||
|
||||
return accumulator
|
||||
}, []).sort((a, b) => (a.name < b.name) ? -1 : (a.name > b.name) ? 1 : 0);
|
||||
}
|
||||
};
|
||||
|
||||
export const flattenTagArrays = (allBookmarkTags) => allBookmarkTags.flat().reduce((accumulator, current) => {
|
||||
if(!accumulator.find((item) => item.id === current.id)) {
|
||||
accumulator.push(current);
|
||||
}
|
||||
|
||||
return accumulator
|
||||
}, []);
|
||||
Reference in New Issue
Block a user