dawarich/app/controllers/api/v1/overland/batches_controller.rb
2025-05-16 18:51:48 +02:00

18 lines
489 B
Ruby

# frozen_string_literal: true
class Api::V1::Overland::BatchesController < ApiController
before_action :authenticate_active_api_user!, only: %i[create]
before_action :validate_points_limit, only: %i[create]
def create
Overland::BatchCreatingJob.perform_later(batch_params, current_api_user.id)
render json: { result: 'ok' }, status: :created
end
private
def batch_params
params.permit(locations: [:type, { geometry: {}, properties: {} }], batch: {})
end
end