1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-04 15:24:23 +01:00
fab-manager/app/controllers/open_api/v1/spaces_controller.rb
2022-11-23 11:59:06 +01:00

22 lines
442 B
Ruby

# frozen_string_literal: true
# authorized 3rd party softwares can fetch data about spaces through the OpenAPI
class OpenAPI::V1::SpacesController < OpenAPI::V1::BaseController
extend OpenAPI::ApiDoc
expose_doc
before_action :set_space, only: %i[show]
def index
@spaces = Space.order(:created_at).where(deleted_at: nil)
end
def show; end
private
def set_space
@space = Space.friendly.find(params[:id])
end
end