2024-05-18 07:58:02 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
2024-08-25 14:19:02 -04:00
|
|
|
class Api::V1::Overland::BatchesController < ApiController
|
2025-02-19 15:23:11 -05:00
|
|
|
before_action :authenticate_active_api_user!, only: %i[create]
|
2025-05-16 12:51:48 -04:00
|
|
|
before_action :validate_points_limit, only: %i[create]
|
2025-02-19 15:23:11 -05:00
|
|
|
|
2024-04-06 13:09:38 -04:00
|
|
|
def create
|
2024-05-25 07:26:56 -04:00
|
|
|
Overland::BatchCreatingJob.perform_later(batch_params, current_api_user.id)
|
2024-04-06 13:09:38 -04:00
|
|
|
|
|
|
|
|
render json: { result: 'ok' }, status: :created
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
|
|
def batch_params
|
2024-05-25 06:47:25 -04:00
|
|
|
params.permit(locations: [:type, { geometry: {}, properties: {} }], batch: {})
|
2024-04-06 13:09:38 -04:00
|
|
|
end
|
|
|
|
|
end
|