dawarich/app/controllers/api/v1/overland/batches_controller.rb

19 lines
439 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2024-04-06 13:09:38 -04:00
class Api::V1::Overland::BatchesController < ApplicationController
skip_forgery_protection
before_action :authenticate_api_key
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
params.permit(locations: [:type, { geometry: {}, properties: {} }], batch: {})
2024-04-06 13:09:38 -04:00
end
end