Sha256: f2a031bbe5b5a3b5af86f6e24bd812f5414111eef6af4c227772db30525fa90f
Contents?: true
Size: 1.03 KB
Versions: 41
Compression:
Stored size: 1.03 KB
Contents
module Shipit module Api class HooksController < BaseController require_permission :read, :hook, only: %i(index show) require_permission :write, :hook, only: %i(create update destroy) def index render_resources hooks end def show render json: hook end params do requires :delivery_url, String requires :events, Array[String] accepts :content_type, String end def create render_resource hooks.create(params) end params do accepts :delivery_url, String accepts :events, Array[String] accepts :content_type, String end def update hook.update(params) render_resource hook end def destroy render_resource hook.destroy end private def hook hooks.find(params[:id]) end def hooks Hook.where(stack_id: stack_id) end def stack_id stack.id if params[:stack_id].present? end end end end
Version data entries
41 entries across 41 versions & 1 rubygems