accept channel ID in all supported formats

This commit is contained in:
Carsten Otto
2022-05-10 19:25:13 +02:00
committed by Carsten Otto
parent 7a2afd71a2
commit cf03cf259e
2 changed files with 11 additions and 10 deletions

View File

@@ -17,13 +17,13 @@ public class ChanDetailsController {
this.page = pageService;
}
@GetMapping("/channel/{id}")
public String channelDetails(@PathVariable(name = "id") long channelId, Model model) {
@GetMapping("/channel/{channelId}")
public String channelDetails(@PathVariable ChannelId channelId, Model model) {
try {
return page.channelDetails(ChannelId.fromShortChannelId(channelId)).create(model);
return page.channelDetails(channelId).create(model);
} catch (NotFoundException e) {
return page.error("Channel not found.").create(model);
}
}
}
}