Skip to content
Snippets Groups Projects
Commit 9c9a21c7 authored by Jason Salyers's avatar Jason Salyers
Browse files

[JES] Trying another function as a test

parent bf2cee67
No related branches found
No related tags found
2 merge requests!456Release candidate v1 24,!370Jsalyers muting at sql level
...@@ -481,7 +481,7 @@ $function$ ...@@ -481,7 +481,7 @@ $function$
language plpgsql STABLE; language plpgsql STABLE;
DROP FUNCTION IF EXISTS bridge_get_ranked_post_by_created_for_community; DROP FUNCTION IF EXISTS bridge_get_ranked_post_by_created_for_community;
CREATE FUNCTION bridge_get_ranked_post_by_created_for_community( in _community VARCHAR, in _author VARCHAR, in _permlink VARCHAR, in _limit SMALLINT, in _bridge_api BOOLEAN ) CREATE FUNCTION bridge_get_ranked_post_by_created_for_community( in _community VARCHAR, in _author VARCHAR, in _permlink VARCHAR, in _limit SMALLINT, in _bridge_api BOOLEAN, in _observer VARCHAR )
RETURNS SETOF bridge_api_post RETURNS SETOF bridge_api_post
AS AS
$function$ $function$
...@@ -542,6 +542,7 @@ BEGIN ...@@ -542,6 +542,7 @@ BEGIN
LIMIT _limit LIMIT _limit
) as created ) as created
JOIN hive_posts_view hp ON hp.id = created.id JOIN hive_posts_view hp ON hp.id = created.id
WHERE (CASE WHEN _observer IS NOT NULL THEN NOT EXISTS (SELECT 1 FROM muted_accounts_view WHERE observer = _observer AND muted = hp.author) ELSE true END)
ORDER BY created.id DESC ORDER BY created.id DESC
LIMIT _limit; LIMIT _limit;
END END
......
...@@ -252,7 +252,7 @@ async def get_ranked_posts(context, sort:str, start_author:str='', start_permlin ...@@ -252,7 +252,7 @@ async def get_ranked_posts(context, sort:str, start_author:str='', start_permlin
return await process_query_results(result) return await process_query_results(result)
if tag and tag[:5] == 'hive-': if tag and tag[:5] == 'hive-':
result = await _get_ranked_posts_for_communities(db, sort, tag, start_author, start_permlink, limit) result = await _get_ranked_posts_for_communities(db, sort, tag, start_author, start_permlink, limit, observer)
return await process_query_results(result) return await process_query_results(result)
if ( tag and tag != "all" ): if ( tag and tag != "all" ):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment