fix: wire showHidden param through suggestions API, remove dead code
This commit is contained in:
parent
ed33cbb9e7
commit
6573e30d31
2 changed files with 5 additions and 15 deletions
|
|
@ -14,6 +14,7 @@ export default defineEventHandler(async (event) => {
|
|||
const query = getQuery(event)
|
||||
const filterTag = query.tag || null
|
||||
const filterState = query.state || null
|
||||
const showHidden = query.showHidden === 'true'
|
||||
|
||||
// Build the set of tag slugs to match against
|
||||
let myTopics = topics
|
||||
|
|
@ -65,8 +66,8 @@ export default defineEventHandler(async (event) => {
|
|||
if (conn.status === 'confirmed' || conn.status === 'pending') {
|
||||
excludeIds.add(otherId)
|
||||
}
|
||||
// Exclude if current member has hidden this connection
|
||||
if (conn.hiddenBy?.some(id => id.toString() === memberId.toString())) {
|
||||
// Exclude if current member has hidden this connection (unless showHidden)
|
||||
if (!showHidden && conn.hiddenBy?.some(id => id.toString() === memberId.toString())) {
|
||||
excludeIds.add(otherId)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue