Sha256: 0adca106fdd1e07c4fa8a4607cc9dc45f2b4c42c4808416eb786bc79b71a5c0b

Contents?: true

Size: 822 Bytes

Versions: 1

Compression:

Stored size: 822 Bytes

Contents

module RailsConnector

  class WorkspacesController < WebserviceController
    def index
      render json: CmsRestApi.get('workspaces')
    end

    def create
      render json: CmsRestApi.post('workspaces', {workspace: workspace_params})
    end

    def update
      render json: CmsRestApi.put("workspaces/#{params[:id]}", {workspace: workspace_params})
    end

    def destroy
      render json: CmsRestApi.delete("workspaces/#{params[:id]}")
    end

    def publish
      render json: CmsRestApi.put("workspaces/#{params[:id]}/publish", {})
    end

    private

    def workspace_params
      raise "Required parameter 'workspace' is missing." unless params[:workspace].present?
      raise "Parameter 'workspace' is not a hash." unless params[:workspace].is_a?(Hash)
      params[:workspace]
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
infopark_cloud_connector-6.9.1.3.22208381 app/controllers/rails_connector/workspaces_controller.rb