fix import_params to pass nested game data
This commit is contained in:
parent
513f8c6a66
commit
5666ee300c
4 changed files with 20 additions and 8 deletions
|
|
@ -120,10 +120,10 @@ module Api
|
|||
|
||||
render json: {
|
||||
success: result.success?,
|
||||
created: result.created.size,
|
||||
updated: result.updated.size,
|
||||
skipped: result.skipped.size,
|
||||
errors: result.errors
|
||||
created: result.created&.size || 0,
|
||||
updated: result.updated&.size || 0,
|
||||
skipped: result.skipped&.size || 0,
|
||||
errors: result.errors || []
|
||||
}, status: status
|
||||
end
|
||||
|
||||
|
|
@ -176,7 +176,10 @@ module Api
|
|||
end
|
||||
|
||||
def import_params
|
||||
params.permit(:update_existing, data: {})
|
||||
{
|
||||
update_existing: params[:update_existing],
|
||||
data: params[:data]&.to_unsafe_h
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -196,7 +196,10 @@ module Api
|
|||
end
|
||||
|
||||
def import_params
|
||||
params.permit(:update_existing, data: {})
|
||||
{
|
||||
update_existing: params[:update_existing],
|
||||
data: params[:data]&.to_unsafe_h
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -167,7 +167,10 @@ module Api
|
|||
end
|
||||
|
||||
def import_params
|
||||
params.permit(:update_existing, data: {})
|
||||
{
|
||||
update_existing: params[:update_existing],
|
||||
data: params[:data]&.to_unsafe_h
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -177,7 +177,10 @@ module Api
|
|||
end
|
||||
|
||||
def import_params
|
||||
params.permit(:update_existing, data: {})
|
||||
{
|
||||
update_existing: params[:update_existing],
|
||||
data: params[:data]&.to_unsafe_h
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue