From b6be41116280d5d66377363778a88439444fa170 Mon Sep 17 00:00:00 2001 From: chamikaJ Date: Mon, 2 Jun 2025 16:23:34 +0530 Subject: [PATCH] fix(database-functions): correct JSON handling for task members in SQL function - Updated the handling of the 'members' field in the SQL function to ensure proper JSON formatting. - Replaced the use of type casting with direct JSON handling for improved clarity and performance. --- worklenz-backend/database/sql/4_functions.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worklenz-backend/database/sql/4_functions.sql b/worklenz-backend/database/sql/4_functions.sql index 8dbece0e..88ac6a0b 100644 --- a/worklenz-backend/database/sql/4_functions.sql +++ b/worklenz-backend/database/sql/4_functions.sql @@ -4117,7 +4117,7 @@ BEGIN 'color_code_dark', COALESCE((_task_info ->> 'color_code_dark')::TEXT, ''), 'total_tasks', COALESCE((_task_info ->> 'total_tasks')::INT, 0), 'total_completed', COALESCE((_task_info ->> 'total_completed')::INT, 0), - 'members', COALESCE((_task_info ->> 'members')::JSON, '[]'::JSON), + 'members', COALESCE((_task_info -> 'members'), '[]'::JSON), 'completed_at', _task_completed_at, 'status_category', COALESCE(_status_category, '{}'::JSON), 'schedule_id', COALESCE(_schedule_id, 'null'::JSON)