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: {
|
render json: {
|
||||||
success: result.success?,
|
success: result.success?,
|
||||||
created: result.created.size,
|
created: result.created&.size || 0,
|
||||||
updated: result.updated.size,
|
updated: result.updated&.size || 0,
|
||||||
skipped: result.skipped.size,
|
skipped: result.skipped&.size || 0,
|
||||||
errors: result.errors
|
errors: result.errors || []
|
||||||
}, status: status
|
}, status: status
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -176,7 +176,10 @@ module Api
|
||||||
end
|
end
|
||||||
|
|
||||||
def import_params
|
def import_params
|
||||||
params.permit(:update_existing, data: {})
|
{
|
||||||
|
update_existing: params[:update_existing],
|
||||||
|
data: params[:data]&.to_unsafe_h
|
||||||
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -196,7 +196,10 @@ module Api
|
||||||
end
|
end
|
||||||
|
|
||||||
def import_params
|
def import_params
|
||||||
params.permit(:update_existing, data: {})
|
{
|
||||||
|
update_existing: params[:update_existing],
|
||||||
|
data: params[:data]&.to_unsafe_h
|
||||||
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -167,7 +167,10 @@ module Api
|
||||||
end
|
end
|
||||||
|
|
||||||
def import_params
|
def import_params
|
||||||
params.permit(:update_existing, data: {})
|
{
|
||||||
|
update_existing: params[:update_existing],
|
||||||
|
data: params[:data]&.to_unsafe_h
|
||||||
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -177,7 +177,10 @@ module Api
|
||||||
end
|
end
|
||||||
|
|
||||||
def import_params
|
def import_params
|
||||||
params.permit(:update_existing, data: {})
|
{
|
||||||
|
update_existing: params[:update_existing],
|
||||||
|
data: params[:data]&.to_unsafe_h
|
||||||
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue