Class: Dato::PublishController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/dato/publish_controller.rb

Instance Method Summary collapse

Instance Method Details

#checkObject



17
18
19
20
21
# File 'app/controllers/dato/publish_controller.rb', line 17

def check
  if request.headers["Authorization"] != Dato::Config.publish_key
    render json: {message: "unauthorized"}, status: :unauthorized
  end
end

#createObject



9
10
11
12
13
14
15
# File 'app/controllers/dato/publish_controller.rb', line 9

def create
  Rails.cache.clear(namespace: Dato::Config.cache_namespace)

  notify_success

  render json: {message: "ok"}, status: :ok
end