Skip to content

Commit

Permalink
chore(project): add groups and rename customer mapping function
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianMoll committed Sep 10, 2024
1 parent 292a8a7 commit 808dcbd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/sync-actions/src/projects-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const actionsMapBusinessUnit = (diff, oldObj, newObj) => {
})
}

export function actionsMapCustomer(diff, oldObj, newObj) {
export function actionsMapSearchIndexingConfiguration(diff, oldObj, newObj) {
const { searchIndexing } = diff

if (!searchIndexing) {
Expand Down
16 changes: 12 additions & 4 deletions packages/sync-actions/src/projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ import createMapActionGroup from './utils/create-map-action-group'
import {
actionsMapBase,
actionsMapBusinessUnit,
actionsMapCustomer,
actionsMapSearchIndexingConfiguration,
} from './projects-actions'
import * as diffpatcher from './utils/diffpatcher'

export const actionGroups = ['base']
export const actionGroups = [
'base',
'businessUnit',
'searchIndexingConfiguration',
]

function createChannelsMapActions(mapActionGroup, syncActionConfig) {
return function doMapActions(diff, newObj, oldObj) {
Expand All @@ -21,11 +25,15 @@ function createChannelsMapActions(mapActionGroup, syncActionConfig) {
)

allActions.push(
mapActionGroup('base', () => actionsMapBusinessUnit(diff, oldObj, newObj))
mapActionGroup('businessUnit', () =>
actionsMapBusinessUnit(diff, oldObj, newObj)
)
)

allActions.push(
mapActionGroup('base', () => actionsMapCustomer(diff, oldObj, newObj))
mapActionGroup('searchIndexingConfiguration', () =>
actionsMapSearchIndexingConfiguration(diff, oldObj, newObj)
)
)

return flatten(allActions)
Expand Down
6 changes: 5 additions & 1 deletion packages/sync-actions/test/projects-sync.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ import {

describe('Exports', () => {
test('action group list', () => {
expect(actionGroups).toEqual(['base'])
expect(actionGroups).toEqual([
'base',
'businessUnit',
'searchIndexingConfiguration',
])
})

describe('action list', () => {
Expand Down

0 comments on commit 808dcbd

Please sign in to comment.