Fix #4982: Add route to remove a post from a favorite group

This commit is contained in:
evazion
2022-05-02 15:43:44 -05:00
parent d2502a0c40
commit 17ffe3590a
5 changed files with 47 additions and 0 deletions

View File

@@ -59,4 +59,12 @@ class FavoriteGroupsController < ApplicationController
respond_with(@favorite_group)
end
def remove_post
@favorite_group = authorize FavoriteGroup.find(params[:id])
@post = Post.find(params[:post_id])
@favorite_group.remove(@post)
respond_with(@favorite_group)
end
end