feature #7: Add routes for comment article
This commit is contained in:
@@ -1,20 +1,17 @@
|
||||
create or replace function edit_comment(reference regclass, id uuid, content text) returns void
|
||||
create or replace function edit_comment(reference regclass, _id uuid, _content text) returns void
|
||||
language plpgsql as
|
||||
$$
|
||||
declare
|
||||
_id alias for id;
|
||||
_content alias for content;
|
||||
begin
|
||||
if reference = 'article'::regclass then
|
||||
update comment_on_article c set
|
||||
content = _content
|
||||
"content" = _content
|
||||
where c.id = _id;
|
||||
elseif reference = 'constitution'::regclass then
|
||||
update comment_on_constitution c set
|
||||
content = _content
|
||||
"content" = _content
|
||||
where c.id = _id;
|
||||
end if;
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists edit_comment(regclass, uuid, uuid, text, uuid);
|
||||
-- drop function if exists edit_comment(regclass, uuid, text);
|
||||
Reference in New Issue
Block a user