mirror of https://github.com/docusealco/docuseal
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
519 B
21 lines
519 B
# frozen_string_literal: true
|
|
|
|
module Api
|
|
class SubmittersRequestChangesController < ApiBaseController
|
|
before_action :load_submitter
|
|
|
|
def request_changes
|
|
@submitter.update!(changes_requested_at: Time.current, completed_at: nil) unless @submitter.changes_requested_at?
|
|
|
|
render json: Submitters::SerializeForApi.call(@submitter), status: :ok
|
|
end
|
|
|
|
private
|
|
|
|
def load_submitter
|
|
@submitter = Submitter.find_by!(slug: params[:slug])
|
|
authorize! :read, @submitter
|
|
end
|
|
end
|
|
end
|