Welcome to mirror list, hosted at ThFree Co, Russian Federation.

broadcast_messages.rb « v3 « api « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 417e4ad0b263d232ac7b24de127571dc14720122 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
module API
  module V3
    class BroadcastMessages < Grape::API
      include PaginationParams

      before { authenticate! }
      before { authenticated_as_admin! }

      resource :broadcast_messages do
        helpers do
          def find_message
            BroadcastMessage.find(params[:id])
          end
        end

        desc 'Delete a broadcast message' do
          detail 'This feature was introduced in GitLab 8.12.'
          success ::API::Entities::BroadcastMessage
        end
        params do
          requires :id, type: Integer, desc: 'Broadcast message ID'
        end
        delete ':id' do
          message = find_message

          present message.destroy, with: ::API::Entities::BroadcastMessage
        end
      end
    end
  end
end