2024-05-25 06:57:39 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
2024-08-25 14:19:02 -04:00
|
|
|
class Api::V1::Owntracks::PointsController < 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-05-25 06:57:39 -04:00
|
|
|
def create
|
2024-05-25 08:08:40 -04:00
|
|
|
Owntracks::PointCreatingJob.perform_later(point_params, current_api_user.id)
|
2024-05-25 06:57:39 -04:00
|
|
|
|
|
|
|
|
render json: {}, status: :ok
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
|
|
def point_params
|
|
|
|
|
params.permit!
|
|
|
|
|
end
|
|
|
|
|
end
|