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

[JES] Trying another function as a test

parent 8cb20ba0
No related branches found
No related tags found
2 merge requests!456Release candidate v1 24,!370Jsalyers muting at sql level
This commit is part of merge request !370. Comments created here will be created in the context of that merge request.
......@@ -481,7 +481,7 @@ $function$
language plpgsql STABLE;
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
AS
$function$
......@@ -542,6 +542,7 @@ BEGIN
LIMIT _limit
) as created
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
LIMIT _limit;
END
......
......@@ -252,7 +252,7 @@ async def get_ranked_posts(context, sort:str, start_author:str='', start_permlin
return await process_query_results(result)
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)
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