mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-16 06:06:56 +08:00
29 lines
727 B
Ruby
29 lines
727 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Api
|
|
module V1
|
|
class TaskUsersController < BaseController
|
|
before_action :load_team
|
|
before_action :load_project
|
|
before_action :load_experiment
|
|
before_action :load_task
|
|
before_action :load_user, only: :show
|
|
|
|
def index
|
|
users = timestamps_filter(@task.users).page(params.dig(:page, :number))
|
|
.per(params.dig(:page, :size))
|
|
render jsonapi: users, each_serializer: UserSerializer
|
|
end
|
|
|
|
def show
|
|
render jsonapi: @user, serializer: UserSerializer
|
|
end
|
|
|
|
private
|
|
|
|
def load_user
|
|
@user = @task.users.find(params.require(:id))
|
|
end
|
|
end
|
|
end
|
|
end
|