Skip to content

Commit

Permalink
fix: Default categories and sublegends appear in contextual catalogs (c…
Browse files Browse the repository at this point in the history
…loses #848)
  • Loading branch information
claustres committed May 27, 2024
1 parent 93044a8 commit 2345c9d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions map/api/services/catalog/catalog.hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import fuzzySearch from 'feathers-mongodb-fuzzy-search'
import { hooks as coreHooks } from '../../../../core/api/index.js'
import { filterLayers, updateLayerReferences, updateProjects, getDefaultCategories, getDefaultSublegends } from '../../hooks/index.js'

const { setNow, discard } = common
const { setNow, discard, when } = common

export default {
before: {
Expand Down Expand Up @@ -47,9 +47,8 @@ export default {
coreHooks.convertToJson(['schema.content', 'filters'])
],
find: [
// Merge built-in categories with user-defined ones
getDefaultCategories,
getDefaultSublegends
// Merge built-in categoriessublegends with user-defined ones for global catalog only
when(hook => !hook.service.getContextId(), getDefaultCategories, getDefaultSublegends)
],
get: [],
create: [],
Expand Down

0 comments on commit 2345c9d

Please sign in to comment.