Fix broken tag clearing on lists and campaign updation

This commit is contained in:
Kailash Nadh 2020-08-01 13:09:52 +05:30
parent 0145aba30f
commit 9c8b7ad7f8

View file

@ -314,7 +314,7 @@ UPDATE lists SET
name=(CASE WHEN $2 != '' THEN $2 ELSE name END),
type=(CASE WHEN $3 != '' THEN $3::list_type ELSE type END),
optin=(CASE WHEN $4 != '' THEN $4::list_optin ELSE optin END),
tags=(CASE WHEN ARRAY_LENGTH($5::VARCHAR(100)[], 1) > 0 THEN $5 ELSE tags END),
tags=$5::VARCHAR(100)[],
updated_at=NOW()
WHERE id = $1;
@ -560,7 +560,7 @@ WITH camp AS (
content_type=(CASE WHEN $6 != '' THEN $6::content_type ELSE content_type END),
send_at=(CASE WHEN $8 THEN $7::TIMESTAMP WITH TIME ZONE WHEN NOT $8 THEN NULL ELSE send_at END),
status=(CASE WHEN NOT $8 THEN 'draft' ELSE status END),
tags=(CASE WHEN ARRAY_LENGTH($9::VARCHAR(100)[], 1) > 0 THEN $9 ELSE tags END),
tags=$9::VARCHAR(100)[],
template_id=(CASE WHEN $10 != 0 THEN $10 ELSE template_id END),
updated_at=NOW()
WHERE id = $1 RETURNING id