Class: Ecom::Core::SiteCrewsController
Instance Method Summary
collapse
#current_user, #logged_in?
Instance Method Details
#index ⇒ Object
6
7
8
9
10
11
|
# File 'app/controllers/ecom/core/site_crews_controller.rb', line 6
def index
crew_ids = Ecom::Core::SiteCrew.where(site_id: params[:id], status: 'Active').select(:crew_id)
crews = Ecom::Core::Crew.where(id: crew_ids)
serialized = ActiveModelSerializers::SerializableResource.new(crews)
render json: { success: true, data: serialized }
end
|
#update ⇒ Object
13
14
15
16
17
|
# File 'app/controllers/ecom/core/site_crews_controller.rb', line 13
def update
data = @service.update(params)
serialized = ActiveModelSerializers::SerializableResource.new(data[:data])
render json: { success: true, data: serialized }
end
|