summaryrefslogtreecommitdiff
path: root/lib/Travelynx.pm
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-08-23 12:02:22 +0200
committerDaniel Friesel <derf@finalrewind.org>2019-08-23 12:02:22 +0200
commita40aa1936bc088c76145600a2b074f8fb20079f5 (patch)
tree58be9cc212eff4196eec5b30bf5fc36de788dc02 /lib/Travelynx.pm
parentf6d56d3134f6045726cb1d4ed8700382575bb686 (diff)
Allow comments to be edited
Diffstat (limited to 'lib/Travelynx.pm')
-rwxr-xr-xlib/Travelynx.pm17
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm
index 3af35c2..b1febce 100755
--- a/lib/Travelynx.pm
+++ b/lib/Travelynx.pm
@@ -761,6 +761,19 @@ sub startup {
}
)->rows;
}
+ elsif ( $key eq 'comment' ) {
+ $journey->{user_data}{comment} = $value;
+ $rows = $db->update(
+ 'journeys',
+ {
+ user_data =>
+ JSON->new->encode( $journey->{user_data} ),
+ },
+ {
+ id => $journey_id,
+ }
+ )->rows;
+ }
else {
die("Invalid key $key\n");
}
@@ -2228,9 +2241,7 @@ sub startup {
messages => $entry->{messages},
route => $entry->{route},
edited => $entry->{edited},
- comment => $entry->{user_data}
- ? $entry->{user_data}{comment}
- : undef,
+ user_data => $entry->{user_data},
};
if ( $opt{verbose} ) {