pie code made functional and relevant distance code updated
This commit is contained in:
parent
c4b7fa5102
commit
88aa5becff
4 changed files with 60 additions and 11 deletions
|
@ -92,6 +92,11 @@ sub update {
|
|||
return $c->redirect_to( '/admin/users/' . $id );
|
||||
}
|
||||
|
||||
my $location = $c->get_location_from_postcode(
|
||||
$validation->param('postcode'),
|
||||
$user->type,
|
||||
);
|
||||
|
||||
if ( $user->type eq 'customer' ){
|
||||
|
||||
try {
|
||||
|
@ -100,6 +105,7 @@ sub update {
|
|||
full_name => $validation->param('full_name'),
|
||||
display_name => $validation->param('display_name'),
|
||||
postcode => $validation->param('postcode'),
|
||||
( defined $location ? ( %$location ) : ( latitude => undef, longitude => undef ) ),
|
||||
});
|
||||
$user->update({
|
||||
email => $validation->param('email'),
|
||||
|
@ -125,6 +131,7 @@ sub update {
|
|||
town => $validation->param('town'),
|
||||
sector => $validation->param('sector'),
|
||||
postcode => $validation->param('postcode'),
|
||||
( defined $location ? ( %$location ) : ( latitude => undef, longitude => undef ) ),
|
||||
});
|
||||
$user->update({
|
||||
email => $validation->param('email'),
|
||||
|
|
Reference in a new issue