Merge commit 'c36db57acedf0033c090748125c665a0360cd11f' into glitch-soc/merge-upstream
This commit is contained in:
commit
8b95254883
106 files changed
+1945
-561
No files matched your search
@@ -21,7 +21,7 @@ class Api::V1Alpha::CollectionItemsController < Api::BaseController
|
||||
|
||||
@item = AddAccountToCollectionService.new.call(@collection, @account)
|
||||
|
||||
render json: @item, serializer: REST::CollectionItemSerializer
|
||||
render json: @item, serializer: REST::CollectionItemSerializer, adapter: :json
|
||||
end
|
||||
|
||||
def destroy
|
||||
|
||||
@@ -26,16 +26,18 @@ class Api::V1Alpha::CollectionsController < Api::BaseController
|
||||
|
||||
def index
|
||||
cache_if_unauthenticated!
|
||||
authorize Collection, :index?
|
||||
authorize @account, :index_collections?
|
||||
|
||||
render json: @collections, each_serializer: REST::BaseCollectionSerializer
|
||||
render json: @collections, each_serializer: REST::CollectionSerializer, adapter: :json
|
||||
rescue Mastodon::NotPermittedError
|
||||
render json: { collections: [] }
|
||||
end
|
||||
|
||||
def show
|
||||
cache_if_unauthenticated!
|
||||
authorize @collection, :show?
|
||||
|
||||
render json: @collection, serializer: REST::CollectionSerializer
|
||||
render json: @collection, serializer: REST::CollectionWithAccountsSerializer
|
||||
end
|
||||
|
||||
def create
|
||||
@@ -43,7 +45,7 @@ class Api::V1Alpha::CollectionsController < Api::BaseController
|
||||
|
||||
@collection = CreateCollectionService.new.call(collection_creation_params, current_user.account)
|
||||
|
||||
render json: @collection, serializer: REST::CollectionSerializer
|
||||
render json: @collection, serializer: REST::CollectionSerializer, adapter: :json
|
||||
end
|
||||
|
||||
def update
|
||||
@@ -51,7 +53,7 @@ class Api::V1Alpha::CollectionsController < Api::BaseController
|
||||
|
||||
@collection.update!(collection_update_params) # TODO: Create a service for this to federate changes
|
||||
|
||||
render json: @collection, serializer: REST::CollectionSerializer
|
||||
render json: @collection, serializer: REST::CollectionSerializer, adapter: :json
|
||||
end
|
||||
|
||||
def destroy
|
||||
|
||||
Reference in new issue
Block a user