First draft of API to get a single collection (#37053)

This commit is contained in:
David Roetzel
2025-12-01 16:04:52 +01:00
committed by GitHub
parent 1f9ddb7cf6
commit 2d203ca72a
11 changed files with 152 additions and 5 deletions

View File

@@ -9,7 +9,14 @@ class Api::V1Alpha::CollectionsController < Api::BaseController
before_action -> { doorkeeper_authorize! :write, :'write:collections' }, only: [:create]
before_action :require_user!
before_action :require_user!, only: [:create]
def show
cache_if_unauthenticated!
@collection = Collection.find(params[:id])
render json: @collection, serializer: REST::CollectionSerializer
end
def create
@collection = CreateCollectionService.new.call(collection_params, current_user.account)