summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Controller/Profile.pm
diff options
context:
space:
mode:
authorDerf Null <derf@finalrewind.org>2023-05-21 19:57:56 +0200
committerDerf Null <derf@finalrewind.org>2023-05-21 19:57:56 +0200
commit9b83e1a8f19e7e6b38838fd6330f9827e0966df5 (patch)
tree3484c5184de41e6db1557ccc2f46b35481289207 /lib/Travelynx/Controller/Profile.pm
parentdbc5c38968a11ac17dc99723bc8866de9f739c28 (diff)
/status/:user: respond to JSON
Diffstat (limited to 'lib/Travelynx/Controller/Profile.pm')
-rwxr-xr-xlib/Travelynx/Controller/Profile.pm27
1 files changed, 18 insertions, 9 deletions
diff --git a/lib/Travelynx/Controller/Profile.pm b/lib/Travelynx/Controller/Profile.pm
index e809491..58c9263 100755
--- a/lib/Travelynx/Controller/Profile.pm
+++ b/lib/Travelynx/Controller/Profile.pm
@@ -405,15 +405,24 @@ sub user_status {
$og_data{description} = $tw_data{description} = q{};
}
- $self->render(
- 'user_status',
- name => $name,
- public_level => $user->{public_level},
- journey => $status,
- journey_visibility => $visibility,
- twitter => \%tw_data,
- opengraph => \%og_data,
- version => $self->app->config->{version} // 'UNKNOWN',
+ $self->respond_to(
+ json => {
+ json => {
+ name => $name,
+ status => $self->get_user_status_json_v1( status => $status ),
+ version => $self->app->config->{version} // 'UNKNOWN',
+ },
+ },
+ any => {
+ template => 'user_status',
+ name => $name,
+ public_level => $user->{public_level},
+ journey => $status,
+ journey_visibility => $visibility,
+ twitter => \%tw_data,
+ opengraph => \%og_data,
+ version => $self->app->config->{version} // 'UNKNOWN',
+ },
);
}