change parent_id in comment

This commit is contained in:
2019-09-22 01:16:42 +02:00
parent a37afc1ada
commit dc490dcac3
5 changed files with 28 additions and 22 deletions

View File

@@ -93,7 +93,7 @@ begin
target_id => (created_article->>'id')::uuid,
created_by_id => _citizen_id,
content => 'God not exist'::text,
parent_id => _comment_id::uuid
parent_comment_id => _comment_id::uuid
) into _comment_id_response;
select "comment"(
@@ -101,7 +101,7 @@ begin
target_id => (created_article->>'id')::uuid,
created_by_id => _citizen_id,
content => 'are you really sure ?'::text,
parent_id => _comment_id_response::uuid
parent_comment_id => _comment_id_response::uuid
) into _comment_id_response2;
assert (select count(*) = 3 from "comment"), 'response must be inserted';
assert (select com.parents_ids @> ARRAY[_comment_id] from "comment" com where id = _comment_id_response), 'parents_ids not contain "' || _comment_id::text || '" ' || (select com.parents_ids::text[] from "comment" com where id = _comment_id_response);