aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Admin/Roles.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Admin/Roles.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin/Roles.pm3
1 files changed, 3 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin/Roles.pm b/perllib/FixMyStreet/App/Controller/Admin/Roles.pm
index 902ed6255..279ee695c 100644
--- a/perllib/FixMyStreet/App/Controller/Admin/Roles.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin/Roles.pm
@@ -63,6 +63,7 @@ sub form {
if ($c->get_param('delete_role')) {
$role->delete;
+ $c->forward('/admin/log_edit', [ $role->id, 'role', 'delete' ]);
$c->response->redirect($c->uri_for($self->action_for('index')));
$c->detach;
}
@@ -88,11 +89,13 @@ sub form {
$opts->{body_id} = $c->user->from_body->id;
}
+ my $action = $role->in_storage ? 'edit' : 'add';
my $form = FixMyStreet::App::Form::Role->new(%$opts);
$c->stash(template => 'admin/roles/form.html', form => $form);
$form->process(item => $role, params => $c->req->params);
return unless $form->validated;
+ $c->forward('/admin/log_edit', [ $role->id, 'role', $action ]);
$c->response->redirect($c->uri_for($self->action_for('index')));
}