| 25 |
split /[\x0D\x0A]+/, $cgi->get_parameter ('tags') // '']; |
split /[\x0D\x0A]+/, $cgi->get_parameter ('tags') // '']; |
| 26 |
|
|
| 27 |
my $hash = get_hash ($en); |
my $hash = get_hash ($en); |
| 28 |
|
my $entry = {en => $en, ja => $ja, tags => $tags, |
| 29 |
|
is_pattern => $is_pattern}; |
| 30 |
|
|
| 31 |
lock_entry ($hash); |
lock_entry ($hash); |
| 32 |
set_entry ($hash, $is_pattern => {en => $en, ja => $ja, tags => $tags}); |
set_entry ($hash, $is_pattern => $entry); |
| 33 |
commit_entries ("$path: $hash updated by $ENV{AUTH_USER}"); |
commit_entries ("$path: $hash updated by $ENV{AUTH_USER}"); |
| 34 |
|
|
| 35 |
print "Status: 204 Saved\n\n"; |
print "Status: 200 Saved\n"; |
| 36 |
|
|
| 37 |
|
my $updates = {$hash => $entry}; |
| 38 |
|
|
| 39 |
|
binmode STDOUT, ':encoding(utf-8)'; |
| 40 |
|
print "Content-Type: application/json\n\n"; |
| 41 |
|
|
| 42 |
|
require JSON; |
| 43 |
|
print scalar JSON::objToJson ($updates); |
| 44 |
exit; |
exit; |
| 45 |
} else { |
} else { |
| 46 |
print q[Status: 405 Method Not Allowed |
print q[Status: 405 Method Not Allowed |