1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-29 10:24:20 +01:00
fab-manager/app/controllers/api/version_controller.rb

17 lines
416 B
Ruby

# frozen_string_literal: true
require 'version'
# API Controller to get the fab-manager version
class API::VersionController < API::ApiController
before_action :authenticate_user!
def show
authorize :version
update_status = Setting.find_by(name: 'hub_last_version')&.value || '{}'
json = JSON.parse(update_status)
json['current'] = Version.current
render json: json, status: :ok
end
end