blob: 7fc5e548d6a0016de71f9742214155a2fe2eab44 (
plain) (
blame)
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
|
# frozen_string_literal: true
class Api::SalmonController < ApiController
before_action :set_account
respond_to :txt
def update
payload = request.body.read
if !payload.nil? && verify?(payload)
SalmonWorker.perform_async(@account.id, payload.force_encoding('UTF-8'))
head 201
else
head 202
end
end
private
def set_account
@account = Account.find(params[:id])
end
def verify?(payload)
VerifySalmonService.new.call(payload)
end
end
|