redirect to new feed after subscribe now works even for existing feeds

This commit is contained in:
Athou
2022-08-13 18:53:34 +02:00
parent 9ec62bc1de
commit 4e5fd18eea
5 changed files with 14 additions and 15 deletions

View File

@@ -400,8 +400,8 @@ public class FeedREST {
category = feedCategoryDAO.findById(Long.valueOf(req.getCategoryId()));
}
FeedInfo info = fetchFeedInternal(url);
FeedSubscription subscription = feedSubscriptionService.subscribe(user, info.getUrl(), req.getTitle(), category);
return Response.ok(subscription).build();
long subscriptionId = feedSubscriptionService.subscribe(user, info.getUrl(), req.getTitle(), category);
return Response.ok(subscriptionId).build();
} catch (Exception e) {
log.error("Failed to subscribe to URL {}: {}", url, e.getMessage(), e);
return Response.status(Status.SERVICE_UNAVAILABLE).entity("Failed to subscribe to URL " + url + ": " + e.getMessage()).build();