Compare commits

...

2 Commits

Author SHA1 Message Date
Citlali del Rey 18994b5543
Fix 500 error when pin doesn't have a name 2023-09-01 12:52:08 -07:00
Citlali del Rey fc74265795
Revert "exclude pin name if empty or null"
This reverts commit 741fcf8b19.
2023-09-01 12:50:08 -07:00
1 changed files with 6 additions and 7 deletions

View File

@ -70,16 +70,15 @@ sub get($c) {
})
}
my %pinobj;
$pinobj{cid} = $pin->{cid};
$pinobj{name} = $pin->{name} if defined $pin->{name} and $pin->{name} ne "";
return $c->render(status => 200, openapi => {
requestid => $pin->{id},
# TODO
status => "pinned",
created => IpfsUpload::Util::date_format($pin->{created_at}),
pin => \%pinobj,
pin => {
cid => $pin->{cid},
name => $pin->{name} || $pin->{cid},
},
delegates => $c->config->{ipfs}->{delegates},
meta => { app_name => $pin->{app_name}},
});
@ -225,7 +224,7 @@ sub replace($c) {
created => IpfsUpload::Util::date_format($pin->{created_at}),
pin => {
cid => $cid,
name => $name,
name => $name || $cid,
},
delegates => $c->config->{ipfs}->{delegates},
meta => { app_name => $app_name},
@ -387,7 +386,7 @@ sub add($c) {
created => IpfsUpload::Util::date_format($res->{created_at}),
pin => {
cid => $cid,
name => $name,
name => $name || $cid,
},
delegates => $c->config->{ipfs}->{delegates},
meta => { app_name => $app_name},