Sha256: 742330fb0b2d6fe77197e50781636580bc22649af5cddcd3aee3ac19b99469bd
Contents?: true
Size: 971 Bytes
Versions: 3
Compression:
Stored size: 971 Bytes
Contents
module RailsConnector class WorkspacesController < WebserviceController def index render json: CmsRestApi.task_unaware_request(:get, 'workspaces') end def create render json: CmsRestApi.task_unaware_request(:post, 'workspaces', { workspace: workspace_params, }) end def update render json: CmsRestApi.task_unaware_request(:put, "workspaces/#{params[:id]}", { workspace: workspace_params, }) end def destroy render json: CmsRestApi.task_unaware_request(:delete, "workspaces/#{params[:id]}") end def publish render json: CmsRestApi.task_unaware_request(: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
3 entries across 3 versions & 1 rubygems