Skip to content

Commit

Permalink
chore: remove loop from discard mutation
Browse files Browse the repository at this point in the history
  • Loading branch information
BCerki committed Jul 21, 2023
1 parent d72bbc1 commit 960a274
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ form_change_record record;

begin

if form_change_record.operation = 'create' then
delete from cif.form_change where id = $1;
return form_change_record;
else
update cif.form_change set operation = 'archive' where id = $1;
return form_change_record;
end if;
select * from cif.form_change where id = $1 into form_change_record;

if form_change_record.operation = 'create' then
delete from cif.form_change where id = form_change_record.id;
else
update cif.form_change set operation = 'archive' where id = form_change_record.id;
end if;
return form_change_record;
end;

$discard_project_attachment_form_change$ language plpgsql volatile;
Expand Down

0 comments on commit 960a274

Please sign in to comment.