coalesce nil UUID for null agreement
This commit is contained in:
1 parent
997438035b
commit
edcfc8c77f
1 file changed
+2
-2
@@ -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
|
||||||
|
|||||||
Reference in new issue
Block a user