Added LinkTimeline and PreviewCard fetching by id
• Added: - LinkTimeline and PreviewCard fetching by id
This commit is contained in:
17
app/controllers/api/v1/links_controller.rb
Normal file
17
app/controllers/api/v1/links_controller.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Api::V1::LinksController < Api::BaseController
|
||||
before_action :require_user!
|
||||
before_action :set_link
|
||||
|
||||
def show
|
||||
render json: @link, serializer: REST::PreviewCardSerializer
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_link
|
||||
@link = PreviewCard.find(params[:id])
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user