File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22 ContentMeta ,
33 ContentQuality ,
44 ContentUpdatedMessage ,
5+ Translation ,
56} from '@dailydotdev/schema' ;
67import { DataSource , ObjectLiteral } from 'typeorm' ;
78import { EntityTarget } from 'typeorm/common/EntityTarget' ;
@@ -138,6 +139,23 @@ export const notifyPostContentUpdated = async ({
138139 } ) ,
139140 deleted : articlePost . deleted ,
140141 sharedPostId : sharePost . sharedPostId || undefined ,
142+ translation : post . translation
143+ ? Object . entries (
144+ typeof post . translation === 'string'
145+ ? JSON . parse ( post . translation )
146+ : post . translation ,
147+ ) . reduce (
148+ ( acc , [ key , value ] ) => {
149+ acc [ key ] = decodeJsonField ( {
150+ value : value as JsonValue ,
151+ decoder : new Translation ( ) ,
152+ } ) ;
153+
154+ return acc ;
155+ } ,
156+ { } as { [ key : string ] : Translation } ,
157+ )
158+ : undefined ,
141159 } ) ;
142160
143161 await triggerTypedEvent (
You can’t perform that action at this time.
0 commit comments