improve mobile view for my orders

remove otp requirement from doctor
This commit is contained in:
Danel Kungla
2025-10-09 17:47:59 +03:00
parent 963d2c6a01
commit 3e60745a92
7 changed files with 154 additions and 89 deletions

View File

@@ -0,0 +1,15 @@
CREATE OR REPLACE FUNCTION medreport.is_doctor()
RETURNS BOOLEAN
LANGUAGE plpgsql
SECURITY DEFINER
AS $$
BEGIN
RETURN EXISTS (
SELECT 1
FROM medreport.accounts
WHERE primary_owner_user_id = auth.uid()
AND application_role = 'doctor'
);
END;
$$;
grant execute on function medreport.is_doctor() to authenticated;