File tree Expand file tree Collapse file tree
services/apps/data_sink_worker/src/bin Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import isEqual from 'lodash.isequal'
2+ import mergeWith from 'lodash.mergewith'
23
34import { connQx , updateMember } from '@crowd/data-access-layer'
45import {
@@ -159,7 +160,7 @@ setImmediate(async () => {
159160 data . attributes = await mas . setAttributesDefaultValues ( data . attributes )
160161
161162 let attributes : Record < string , unknown > | undefined
162- const temp = { ... data . attributes }
163+ const temp = mergeWith ( { } , oldAttributes , data . attributes )
163164 const manuallyChangedFields : string [ ] = data . manuallyChangedFields || [ ]
164165
165166 if ( manuallyChangedFields . length > 0 ) {
@@ -212,7 +213,7 @@ setImmediate(async () => {
212213 'Updating member attributes' ,
213214 )
214215
215- // await updateMember(pgQx, data.id, { attributes } as any)
216+ await updateMember ( pgQx , data . id , { attributes } as any )
216217 batchUpdated ++
217218 totalUpdated ++
218219 log . debug ( { memberId : data . id } , 'Member attributes updated successfully' )
You can’t perform that action at this time.
0 commit comments