mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
- in any cases, adding status: :no_content dropes content from response - replaced by head :no_content (HTTP 204)
26 lines
519 B
Ruby
26 lines
519 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Api
|
|
module V0
|
|
class EnterpriseFeesController < Api::V0::BaseController
|
|
respond_to :json
|
|
|
|
def destroy
|
|
authorize! :destroy, enterprise_fee
|
|
|
|
if enterprise_fee.destroy
|
|
head :no_content
|
|
else
|
|
render plain: enterprise_fee.errors.full_messages.first, status: :forbidden
|
|
end
|
|
end
|
|
|
|
private
|
|
|
|
def enterprise_fee
|
|
@enterprise_fee ||= EnterpriseFee.find_by id: params[:id]
|
|
end
|
|
end
|
|
end
|
|
end
|