@@ -59,8 +59,8 @@ const convertBaseFromEs = (document: Document) => {
5959 title : document . _source . title ,
6060 created_at : document . _source . created_at ,
6161 updated_at : document . _source . updated_at ,
62- ... ( document . _source . status !== undefined && { status : document . _source . status } ) ,
63- ... ( document . _source . read !== undefined && { read : document . _source . read } ) ,
62+ status : document . _source . status ,
63+ read : document . _source . read ,
6464 } ;
6565} ;
6666
@@ -233,10 +233,8 @@ export const toEs = (conversation: Conversation, space: string): ConversationPro
233233 conversation_rounds : serializeStepResults ( conversation . rounds ) ,
234234 attachments : conversation . attachments ?? [ ] ,
235235 state : conversation . state ,
236- ...( conversation . rounds . length > 0 && {
237- status : conversation . rounds [ conversation . rounds . length - 1 ] . status ,
238- } ) ,
239- ...( conversation . read !== undefined && { read : conversation . read } ) ,
236+ status : conversation . status ,
237+ read : conversation . read ,
240238 } ;
241239} ;
242240
@@ -283,9 +281,7 @@ export const createRequestToEs = ({
283281 conversation_rounds : serializeStepResults ( conversation . rounds ) ,
284282 attachments : conversation . attachments ?? [ ] ,
285283 state : conversation . state ,
286- ...( conversation . rounds . length > 0 && {
287- status : conversation . rounds [ conversation . rounds . length - 1 ] . status ,
288- } ) ,
284+ status : conversation . status ,
289285 read : false ,
290286 } ;
291287} ;
0 commit comments