Sha256: 643e311c4506f5c9c0596e1e19095fffc97471a3a0dddc8fbe81071525dd3351

Contents?: true

Size: 380 Bytes

Versions: 5

Compression:

Stored size: 380 Bytes

Contents

module Spontaneous::Rack::Back
  class Changes < Base
    before do
      forbidden! unless user.level.can_publish?
    end

    get '/?' do
      json(Spontaneous::Change.export(site))
    end

    post '/?' do
      ids = params[:page_ids]
      halt 400 if ids.blank? || ids.empty?
      pages = ids.map(&:to_i)
      site.publish_pages(pages)
      json({})
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
spontaneous-0.2.0.beta9 lib/spontaneous/rack/back/changes.rb
spontaneous-0.2.0.beta8 lib/spontaneous/rack/back/changes.rb
spontaneous-0.2.0.beta7 lib/spontaneous/rack/back/changes.rb
spontaneous-0.2.0.beta6 lib/spontaneous/rack/back/changes.rb
spontaneous-0.2.0.beta5 lib/spontaneous/rack/back/changes.rb