From 4afc498cd774a2d75eec189130d43d4d01db86ba Mon Sep 17 00:00:00 2001 From: Danel Kungla Date: Tue, 23 Sep 2025 14:33:48 +0300 Subject: [PATCH] feedback fix --- app/home/(user)/_components/recommendations.tsx | 2 +- .../20250920184500_update_ai_responses.sql | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/app/home/(user)/_components/recommendations.tsx b/app/home/(user)/_components/recommendations.tsx index 86efd1e..01d0b96 100644 --- a/app/home/(user)/_components/recommendations.tsx +++ b/app/home/(user)/_components/recommendations.tsx @@ -22,7 +22,7 @@ export default async function Recommendations({ analysisRecommendations.includes(analysis.title), ); - if (orderAnalyses.length < 1) { + if (orderAnalyses.length === 0) { return null; } diff --git a/supabase/migrations/20250920184500_update_ai_responses.sql b/supabase/migrations/20250920184500_update_ai_responses.sql index ce0d5b8..0752227 100644 --- a/supabase/migrations/20250920184500_update_ai_responses.sql +++ b/supabase/migrations/20250920184500_update_ai_responses.sql @@ -1,7 +1,17 @@ ALTER TABLE medreport.ai_responses ENABLE ROW LEVEL SECURITY; -CREATE POLICY "ai_responses_select" ON medreport.ai_responses FOR SELECT TO authenticated USING (true); -CREATE POLICY "ai_responses_insert" ON medreport.ai_responses FOR INSERT TO authenticated WITH CHECK (true); +create policy "ai_responses_select" +on medreport.ai_responses +for select +to authenticated +using (account_id = auth.uid()); + +create policy "ai_responses_insert" +on medreport.ai_responses +for insert +to authenticated +with check (account_id = auth.uid()); + grant select, insert, update, delete on table medreport.ai_responses to authenticated; @@ -56,4 +66,3 @@ as $$ $$; grant execute on function medreport.get_latest_analysis_response_elements_for_current_user(uuid) to authenticated, service_role; -