Add a filter on index and show defs: now they only send data for a specific activity
This commit is contained in:
parent
79326510e8
commit
e27c66edee
1 changed files with 2 additions and 2 deletions
|
|
@ -3,7 +3,7 @@ class Api::V1::TasksController < ApplicationController
|
|||
before_action :check_login
|
||||
|
||||
def index
|
||||
render json: TaskSerializer.new(Task.all).serializable_hash.to_json
|
||||
render json: TaskSerializer.new(Activity.find(params[:activity_id]).tasks).serializable_hash.to_json
|
||||
end
|
||||
|
||||
def show
|
||||
|
|
@ -17,6 +17,6 @@ class Api::V1::TasksController < ApplicationController
|
|||
end
|
||||
|
||||
def set_task
|
||||
@task = Task.find(params[:id])
|
||||
@task = Activity.find(params[:activity_id]).tasks.find(params[:id])
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue