Skip to content

Commit

Permalink
File upload via PUT now returns the file identifier on success
Browse files Browse the repository at this point in the history
  • Loading branch information
lomky committed Jul 10, 2018
1 parent 37f53cc commit 4844a93
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/Tuba/Controller.pm
Original file line number Diff line number Diff line change
Expand Up @@ -979,10 +979,11 @@ sub put_files {
$file->filename($c->stash("filename") || 'asset');
my $obj = $c->_this_object or return $c->reply->not_found;
my $pub = $obj->get_publication(autocreate => 1);
$pub->upload_file(c => $c, upload => $file) or do {
my $tfile = $pub->upload_file(c => $c, upload => $file) or do {
return $c->render(status => 500, text => $pub->error);
};
$c->render(text => "ok");
my $file_identifier = $tfile->identifier;
$c->render(status => 200, text => $file_identifier);
}

=head2 update_contributors
Expand Down

0 comments on commit 4844a93

Please sign in to comment.