Skip to content

Commit

Permalink
Merge pull request #169 from novaforgood/Max/block
Browse files Browse the repository at this point in the history
Various fixes
  • Loading branch information
legitmaxwu authored May 15, 2023
2 parents 8714e99 + 8675d75 commit 378f095
Show file tree
Hide file tree
Showing 24 changed files with 1,657 additions and 32 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- CREATE OR REPLACE FUNCTION public.profile_blocked_by_user(profile_row profile, hasura_session json)
-- RETURNS boolean
-- LANGUAGE sql
-- STABLE
-- AS $function$
-- SELECT EXISTS (
-- SELECT 1
-- FROM block
-- JOIN profile ON block.blocker_profile_id = profile.id
-- WHERE block.blocker_profile_id = profile.id
-- AND block.blocked_profile_id = profile.id
-- AND profile.user_id = hasura_session ->> 'x-hasura-user-id'
-- );
-- $function$;
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CREATE OR REPLACE FUNCTION public.profile_blocked_by_user(profile_row profile, hasura_session json)
RETURNS boolean
LANGUAGE sql
STABLE
AS $function$
SELECT EXISTS (
SELECT 1
FROM block
JOIN profile ON block.blocker_profile_id = profile.id
WHERE block.blocker_profile_id = profile.id
AND block.blocked_profile_id = profile.id
AND profile.user_id = hasura_session ->> 'x-hasura-user-id'
);
$function$;
Loading

0 comments on commit 378f095

Please sign in to comment.