Implement comment constitution

fix bugs
This commit is contained in:
2019-08-28 23:32:43 +02:00
parent 33f4992b5e
commit 4c2da6ab71
17 changed files with 277 additions and 86 deletions

View File

@@ -1,17 +1,13 @@
create or replace function edit_comment(reference regclass, _id uuid, _content text) returns void
create or replace function edit_comment(_id uuid, _content text) returns void
language plpgsql as
$$
begin
if reference = 'article'::regclass then
update comment_on_article c set
update comment c set
"content" = _content
where c.id = _id;
elseif reference = 'constitution'::regclass then
update comment_on_constitution c set
"content" = _content
where c.id = _id;
end if;
end;
$$;
-- drop function if exists edit_comment(regclass, uuid, text);
-- drop function if exists edit_comment(regclass, uuid, text);
-- select edit_comment('b0422e48-687f-bea7-b45f-b6b301246e97', 'plop4')