coalesce nil UUID for null agreement

This commit is contained in:
2026-09-14 21:34:22 +00:00
parent 997438035b
commit edcfc8c77f

View File

@@ -53,12 +53,12 @@ async function getEvent(client, userId, id, includeData, meta) {
'senderId', e.sender_id, 'senderId', e.sender_id,
'recipientId', e.recipient_id, 'recipientId', e.recipient_id,
'created', e.created, 'created', e.created,
'agreementId', ( 'agreementId', COALESCE((
SELECT a.agreement_id_uuid SELECT a.agreement_id_uuid
FROM agreement a FROM agreement a
WHERE a.id = e.agreement_id WHERE a.id = e.agreement_id
AND a.user_id = $1 AND a.user_id = $1
), ), '00000000-0000-0000-0000-000000000000'),
${dataSql} ${dataSql}
'created', e.created 'created', e.created
) AS record ) AS record