summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Model/Users.pm
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2023-09-24 18:19:17 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2023-09-24 18:19:17 +0200
commitde074342de0bdc3604a0610a0c5f9cce5338bb85 (patch)
tree721c6c7415945ca57779e51db5dde00e136a62c2 /lib/Travelynx/Model/Users.pm
parent8810acf742629294713448408ab6f0719f17952f (diff)
add support for HAFAS connection suggestions; drop manual destination list
Still TODO: handle stations that have several EVAs
Diffstat (limited to 'lib/Travelynx/Model/Users.pm')
-rw-r--r--lib/Travelynx/Model/Users.pm27
1 files changed, 2 insertions, 25 deletions
diff --git a/lib/Travelynx/Model/Users.pm b/lib/Travelynx/Model/Users.pm
index 4b108d4..4602fa2 100644
--- a/lib/Travelynx/Model/Users.pm
+++ b/lib/Travelynx/Model/Users.pm
@@ -567,7 +567,6 @@ sub delete {
$res{transit} = $db->delete( 'in_transit', { user_id => $uid } );
$res{hooks} = $db->delete( 'webhooks', { user_id => $uid } );
$res{trwl} = $db->delete( 'traewelling', { user_id => $uid } );
- $res{lt} = $db->delete( 'localtransit', { user_id => $uid } );
$res{password} = $db->delete( 'pending_passwords', { user_id => $uid } );
$res{relations} = $db->delete( 'relations',
[ { subject_id => $uid }, { object_id => $uid } ] );
@@ -651,34 +650,12 @@ sub use_history {
my $uid = $opt{uid};
my $value = $opt{set};
- if ( $opt{destinations} ) {
- $db->insert(
- 'localtransit',
- {
- user_id => $uid,
- data =>
- JSON->new->encode( { destinations => $opt{destinations} } )
- },
- { on_conflict => \'(user_id) do update set data = EXCLUDED.data' }
- );
- }
-
if ($value) {
$db->update( 'users', { use_history => $value }, { id => $uid } );
}
else {
- if ( $opt{with_local_transit} ) {
- my $res = $db->select(
- 'user_transit',
- [ 'use_history', 'data' ],
- { id => $uid }
- )->expand->hash;
- return ( $res->{use_history}, $res->{data}{destinations} // [] );
- }
- else {
- return $db->select( 'users', ['use_history'], { id => $uid } )
- ->hash->{use_history};
- }
+ return $db->select( 'users', ['use_history'], { id => $uid } )
+ ->hash->{use_history};
}
}