vol1ura/Sat_9am_5km

View on GitHub
app/controllers/api/parkzhrun/activities_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
# frozen_string_literal: true

module API
  module Parkzhrun
    class ActivitiesController < ApplicationController
      def create
        ::Parkzhrun::ActivityCreator.call params[:date]
        head :created
      rescue StandardError => e
        Rollbar.error e
        render json: { error: "Can't create activity" }, status: :unprocessable_entity
      end
    end
  end
end