redirect to new feed after subscribe

This commit is contained in:
Athou
2022-08-13 17:41:31 +02:00
parent ece9b993e0
commit 33b87312f4
5 changed files with 13 additions and 22 deletions

View File

@@ -399,12 +399,12 @@ public class FeedREST {
category = feedCategoryDAO.findById(Long.valueOf(req.getCategoryId()));
}
FeedInfo info = fetchFeedInternal(url);
feedSubscriptionService.subscribe(user, info.getUrl(), req.getTitle(), category);
FeedSubscription subscription = feedSubscriptionService.subscribe(user, info.getUrl(), req.getTitle(), category);
return Response.ok(subscription).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();
}
return Response.ok().build();
}
@GET