diff --git a/backend/modules/core/data/event.js b/backend/modules/core/data/event.js index 347f464..985e7f2 100644 --- a/backend/modules/core/data/event.js +++ b/backend/modules/core/data/event.js @@ -53,12 +53,12 @@ async function getEvent(client, userId, id, includeData, meta) { 'senderId', e.sender_id, 'recipientId', e.recipient_id, 'created', e.created, - 'agreementId', ( + 'agreementId', COALESCE(( SELECT a.agreement_id_uuid FROM agreement a WHERE a.id = e.agreement_id AND a.user_id = $1 - ), + ), '00000000-0000-0000-0000-000000000000'), ${dataSql} 'created', e.created ) AS record